Skip to content

Instantly share code, notes, and snippets.

@jamesmorgan
Created February 19, 2018 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmorgan/9b7e3bdc1867ba52def203b3aa997b91 to your computer and use it in GitHub Desktop.
Save jamesmorgan/9b7e3bdc1867ba52def203b3aa997b91 to your computer and use it in GitHub Desktop.
Firebase cloud function - http trigger example
const functions = require('firebase-functions');
const admin = require('firebase-admin');
// Define a onRequest trigger - this will be invoked from every webhook
exports.coinbaseToFirebase = functions.https.onRequest((req, res) => {
// Simply log the headers & body (Debug only)
console.log(JSON.stringify(req.headers, null, 4));
console.log(JSON.stringify(req.body, null, 4));
// Parse webhook payload and perform some actions based on success!
return res.status(200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment