Skip to content

Instantly share code, notes, and snippets.

@dudelis
Last active January 5, 2019 00:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dudelis/48db73bf1d2005baddcd1b469ae44b0d to your computer and use it in GitHub Desktop.
Save dudelis/48db73bf1d2005baddcd1b469ae44b0d to your computer and use it in GitHub Desktop.
K2: Integrate Azure Function with REST ServiceBroker
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.query.name || (req.body && req.body.name)) {
var output = req.query.name || req.body.name;
context.res = {
// status: 200, /* Defaults to 200 */
body: {
'output': output
}
};
}
else {
context.res = {
status: 400,
body: "Please pass a name on the query string or in the request body"
};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment