Skip to content

Instantly share code, notes, and snippets.

@mcnkbr
Created March 30, 2021 22:08
Show Gist options
  • Save mcnkbr/4562c9af697a6e7ee12b0b5991b61b2c to your computer and use it in GitHub Desktop.
Save mcnkbr/4562c9af697a6e7ee12b0b5991b61b2c to your computer and use it in GitHub Desktop.
user-post index.js
const userService = require('../services/user');
module.exports = async function(context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.body && req.body.user) {
context.res = {
status: 200,
body: userService.addUser(context)
};
} 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