Skip to content

Instantly share code, notes, and snippets.

@prashanthmadi
Created June 9, 2019 21:13
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 prashanthmadi/5d0206eb5f77ce2d7985afd09e273f5e to your computer and use it in GitHub Desktop.
Save prashanthmadi/5d0206eb5f77ce2d7985afd09e273f5e to your computer and use it in GitHub Desktop.
Azure Function app with request inside async function
const request = require("request-promise");
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
var options = {
uri: 'https://prashanthmadi.github.io/2018/10/10/django-sendgrid.html'
};
var result1 = await request(options);
context.log("done first call");
var result2 = await request(options);
context.log("done second call");
context.res = {
status: 200,
body: result2
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment