Skip to content

Instantly share code, notes, and snippets.

@richardhyatt
Last active May 4, 2017 19:21
Show Gist options
  • Select an option

  • Save richardhyatt/7ab78d16a788dca1a8da4c5bf1a99377 to your computer and use it in GitHub Desktop.

Select an option

Save richardhyatt/7ab78d16a788dca1a8da4c5bf1a99377 to your computer and use it in GitHub Desktop.
Simple POST handler using Vandium
'use strict';
const vandium = require( 'vandium' );
// our datastore
const db = require( './lib/db' );
exports.handler = vandium.api()
.POST( (event) => {
let userName = event.body.userName;
return db.addUser( userName );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment