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(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Sample function for an Azure Function App. Used for this demo