Created
February 19, 2018 09:07
-
-
Save jamesmorgan/9b7e3bdc1867ba52def203b3aa997b91 to your computer and use it in GitHub Desktop.
Firebase cloud function - http trigger example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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