Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Created March 10, 2016 21:16
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 vdeturckheim/74235854885df5c2ce39 to your computer and use it in GitHub Desktop.
Save vdeturckheim/74235854885df5c2ce39 to your computer and use it in GitHub Desktop.
{
config: {
validate: {
payload: {
message: Joi.string(),
username: Joi.string()
}
}
},
method: 'POST',
path: '/new-message',
handler: function (request, reply) {
const msg = new Message(request.payload);
msg
.save()
.then(() => {
reply();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment