Last active
May 4, 2017 19:21
-
-
Save richardhyatt/7ab78d16a788dca1a8da4c5bf1a99377 to your computer and use it in GitHub Desktop.
Simple POST handler using Vandium
This file contains hidden or 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
| '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