Created
October 21, 2020 02:58
-
-
Save jphungcode/d46f11fe765fce8504add483f73d708c to your computer and use it in GitHub Desktop.
This file contains 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 fetchConfig = { | |
method: "POST", | |
headers: { | |
Authorization: "Bearer " + functions.config().pfc.apikey, //api key is stored as a env variable | |
"Content-Type": "application/json", | |
}, | |
body: pfcData, | |
}; | |
fetch(pfcEndpoint, fetchConfig) | |
.then((response) => response.json()) | |
.then((result) => { | |
console.log(result); | |
resolve(result); | |
}) | |
.catch((error) => { | |
console.log(error); | |
reject(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment