Thursday, 16 March 2017

expressjs write multiple middleware and import it to the main file

I have a scritp which holds a middlware like:

modeule.exports = function (req, res, next) { req.requestTime = Date.now() next() }

In a file I can import this but how can I write multiple middleware and export all of them and import it ??

I am learning express and got stuck here :)



via gamer

No comments:

Post a Comment