Skip to content

Instantly share code, notes, and snippets.

@tresende
Last active December 1, 2018 15:03
Show Gist options
  • Save tresende/df636fb2a85509e850bf56916f88906e to your computer and use it in GitHub Desktop.
Save tresende/df636fb2a85509e850bf56916f88906e to your computer and use it in GitHub Desktop.
External http request on ibm cloud functions serverless
const request = require('request');
async function main() {
return await new Promise((resolve, reject) => {
request('https://api.promasters.net.br/cotacao/v1/valores', { json: true }, (err, res, body) => {
resolve({ valor: body.valores['USD'].valor });
});
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment