Open cadesalaberry opened 9 years ago
Check the docs http://mcavage.me/node-restify/
Should look like this:
var restify = require('restify'); function customAuth(req, res, next) { if (req.header('X-Custom-Auth') == "the right one") { next(); } else { res.json(401, {code:401, message: "Auth failed."}); next(); } restify.use(customAuth); }
Check the docs http://mcavage.me/node-restify/
Should look like this: