Last active
December 16, 2016 20:13
-
-
Save viebig/ed33729fb5b886308c32bb6bf92cd2f7 to your computer and use it in GitHub Desktop.
sum12factor index.js v1
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
const restify = require('restify'); | |
const plugins = require('restify-plugins'); | |
const server = restify.createServer(); | |
server.use(plugins.acceptParser(server.acceptable)); | |
server.use(plugins.bodyParser()); | |
server.post('/sum', (req, res, next) => { | |
res.send(200, req.body.reduce((a, b) => a + b, 0)); | |
return next(); | |
}); | |
server.listen(8080); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello