I'm using restify to build an API, and I'm used to express. Is there a way to have restify log every request in the console, like express does with app.use(express.logger('dev'))?
I'm using restify to build an API, and I'm used to express. Is there a way to have restify log every request in the console, like express does with app.use(express.logger('dev'))?
There is a quick way to do it very quickly if you just want to have it for your development environment.
/**
* Log requests.
*/
server.on('after', function(req, res, route, error) {
console.log("------------------------")
console.log(req.route.path)
console.log(req.body)
});