Created
May 15, 2016 20:54
-
-
Save justinyoo/b4d8f1cb4fff53094f92803043a82419 to your computer and use it in GitHub Desktop.
Integrating Slack with AWS Lambda & Azure Functions
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
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