Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created May 15, 2016 20:54
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 justinyoo/b4d8f1cb4fff53094f92803043a82419 to your computer and use it in GitHub Desktop.
Save justinyoo/b4d8f1cb4fff53094f92803043a82419 to your computer and use it in GitHub Desktop.
Integrating Slack with AWS Lambda & Azure Functions
module.exports = function(context, req) {
context.log('Node.js HTTP trigger function processed a request. RequestUri=%s', req.originalUrl);
if (req.query.name || (req.body && req.body.name)) {
context.res = {
// status: 200, /* Defaults to 200 */
body: "Hello " + (req.query.name || req.body.name)
};
}
else {
context.res = {
status: 400,
body: "Please pass a name on the query string or in the request body"
};
}
context.done();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment