Logging all requests in Node.js/Express
Expressjs adapts its functionality based on what type of callback you give it (this is not common in JS libraries so it is not surprising that people get confused by it). If you do this where your callback has four arguments: app.use(function(error, req, res, next) {…}); then Express assumes this is an error-only middleware handler … Read more