Created
June 9, 2019 21:13
-
-
Save prashanthmadi/5d0206eb5f77ce2d7985afd09e273f5e to your computer and use it in GitHub Desktop.
Azure Function app with request inside async function
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 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