Skip to content

Instantly share code, notes, and snippets.

@wordyallen
Created July 1, 2018 18:33
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 wordyallen/85d01aef59b276b8930be9fe6aaafee1 to your computer and use it in GitHub Desktop.
Save wordyallen/85d01aef59b276b8930be9fe6aaafee1 to your computer and use it in GitHub Desktop.
functionz
module.exports.hello = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.query.name || (req.body && req.body.name)) {
res = {
// status: 200, /* Defaults to 200 */
body: "Hello " + (req.query.name || req.body.name)
};
}
else {
res = {
status: 400,
body: "Please pass a name on the query string or in the request body"
};
}
context.done(null, res);
};
module.exports.helloQueue = function (context, queueItem) {
context.log('JavaScript queue trigger function processed work item', queueItem);
context.bindings.blobOut = {
"hello": "world"
}
context.done();
};%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment