Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
/*
This function simply returns messages as a JSON in response to any request
Definitely not what you would want to have in a production environment, but will suffice for the demo
Note the content-type header for 'application/json'
*/
context.res = {
// status: 200, /* Defaults to 200 */
body: {"messages": [
{"id":1,"content":"Hello"},
{"id":2,"content":"Serverless"},
{"id":3,"content":"Azure"}
]},
headers: {
'Content-Type': 'application/json'
}
};
context.done();
};
@imalchenko

This comment has been minimized.

Copy link
Owner Author

@imalchenko imalchenko commented Aug 9, 2017

Sample function for an Azure Function App. Used for this demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.