Skip to content

Instantly share code, notes, and snippets.

@viebig
Last active December 16, 2016 20:13
Show Gist options
  • Save viebig/ed33729fb5b886308c32bb6bf92cd2f7 to your computer and use it in GitHub Desktop.
Save viebig/ed33729fb5b886308c32bb6bf92cd2f7 to your computer and use it in GitHub Desktop.
sum12factor index.js v1
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);
@Stellacolly1
Copy link

hello

@viebig
Copy link
Author

viebig commented Dec 16, 2016

hey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment