Skip to content

Instantly share code, notes, and snippets.

@alexmipego
Created December 4, 2014 15:26
Show Gist options
  • Save alexmipego/71d03c632b76c96dfc2c to your computer and use it in GitHub Desktop.
Save alexmipego/71d03c632b76c96dfc2c to your computer and use it in GitHub Desktop.
var restify = require('restify');
function respond(req, res, next) {
res.send(req.params);
next();
}
var server = restify.createServer();
server.use(restify.bodyParser());
server.get('/hello/:name', respond);
server.post('/hello/:name', respond);
server.listen(8080, function() {
console.log('%s listening at %s', server.name, server.url);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment