shortrest
v9.0.0
Published
Drop the boilerplate for simple REST servers
Downloads
52
Maintainers
Readme
Drop the boilerplate for simple REST servers. Wraps restify. Also includes restify-jwt
as a global.
var web = require('shortrest')(8099);
web.get('/echo/:name', function (req, res) {
res.send(req.params);
});
Example using JWT:
var web = require('shortrest')(8099);
web.get('/protected',
jwt({secret: 'shhhhhhared-secret'}),
function(req, res) {
if (!req.user.admin) return res.send(401);
res.send(200);
});