Last active
June 22, 2020 03:57
-
-
Save FelixEhuan/28eae8d3fc3b12919a52109d6b4733b3 to your computer and use it in GitHub Desktop.
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
import * as functions from 'firebase-functions'; | |
import * as admin from 'firebase-admin'; | |
import * as request from 'request-promise'; | |
const ACTIVE_KEY = 'SOME-KEY' | |
export const callableFunction = () => functions.https.onCall( (data) => { | |
const data = snapshot.data(); | |
const options = { | |
method: 'POST', | |
uri: ' https://travelcoach.api-us1.com/api/3/contacts', | |
headers: { | |
'Api-Token': ACTIVE_KEY | |
}, | |
body: { data }, | |
json: true // Automatically parses the JSON string in the response | |
}; | |
return await request(options); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment