This code uses a middleware function AND a handler. (handler chained to middleware function ?)
app.get('/now', function(req,res,next) {
req.time = new Date().toString();
next();
}, function(req,res) {
res.send({"time":req.time})
})
Would this still be the same if we used only a handler?
So what does the middleware function add?
app.get('/now', function(req,res) {
req.time = new Date().toString();
res.send({"time":req.time});
});