Created
December 4, 2014 15:26
-
-
Save alexmipego/71d03c632b76c96dfc2c to your computer and use it in GitHub Desktop.
This file contains 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
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