I want to just verify something but have\'t been able to find anything in the Express docs or online regarding this (although I know it\'s a feature).
I could just t
Consider following example:
var middleware = {
requireAuthentication: function(req, res, next) {
console.log('private route list!');
next();
},
logger: function(req, res, next) {
console.log('Original request hit : '+req.originalUrl);
next();
}
}
Now you can add multiple middleware using the following code:
app.get('/', [middleware.requireAuthentication, middleware.logger], function(req, res) {
res.send('Hello!');
});
So, from above piece of code, you can see that "requireAuthentication" and "logger" are two different middlewares added.