title: Firebase Function HTTP Trigger - Error: could not handle the request - Firebase Not Defined
body: <p><em>Apologies in advance if my syntax isn't correct as I'm a newbie to Firebase (and to node.js).</em></p>
  
  <p>Using a HTTP trigger, I'm trying to pull 'awards' data as an object from my Realtime Database. However, based on my setup I am receiving the following error when I execute the URL that I receive from <code>firebase deploy</code>. </p>
  
  <blockquote>
    <p>Error: could not handle the request</p>
  </blockquote>
  
  <p>I did change <code>firebase</code> to <code>admin</code> as described <a href="https://stackoverflow.com/questions/45954866/referenceerror-firebase-is-not-defined-in-cloud-functions">here</a> but that didn't resolve the issue.  </p>
  
  <p>Additionally I thought the .catch() method would at least give me an understanding of what the issue is vs just telling me 'error'. </p>
  
  <p>I'm hoping the end result be: </p>
  
  <pre><code>{"create_your_own":"false","first_time":"true","five_in_a_row":"true", "share_with_friend": "false"}
  </code></pre>
  
  <p>Any help in deciphering my issue is greatly appreciated. </p>
  
  <p><strong>Functions log</strong></p>
  
  <p><a href="https://i.stack.imgur.com/E3BTE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E3BTE.png" alt="enter image description here"></a></p>
  
  <p><strong>Realtime Database</strong></p>
  
  <pre><code>fir-db-test-mike
   |
   |__awards
   |   |
   |   |__user01
   |   |   |
   |   |   |__create_your_own: false
   |   |   |__first_time: true
   |   |   |__five_in_a_row: true
   |   |   |__share_with_friend: false
   |   |
   |   |
   |   |__user02
   |       |
   |       |__create_your_own: false
   |       |__first_time: false
   |       |__five_in_a_row: false
   |       |__share_with_friend: false
  </code></pre>
  
  <p><strong>index.js</strong></p>
  
  <pre><code>const functions = require('firebase-functions');
  require('./src/grabData')(module.exports);
  </code></pre>
  
  <p><strong>grabData.js</strong></p>
  
  <pre><code>const functions = require('firebase-functions')
  const admin = require('firebase-admin')
  admin.initializeApp(functions.config().firebase)
  
  26 module.exports = (event) =&gt; {
  27   event.grabAwards = functions.https.onRequest((request, response) =&gt; {
  28     firebase.database().ref('/awards/{pushId}').once('value')
         .then(function(snapshot) {
  29       var awards = snapshot.val();
  30       res.status(200).send(awards);
  31       }).catch(error =&gt; {
  32       this.errorMessage = 'Error - ' + error.message
  33     });
  34   })
  35 }
  </code></pre>