diff options
Diffstat (limited to 'middleware')
-rw-r--r-- | middleware/logger.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/middleware/logger.js b/middleware/logger.js index e69de29..bc7012e 100644 --- a/middleware/logger.js +++ b/middleware/logger.js @@ -0,0 +1,12 @@ +const moment = require('moment'); + +const logger = (req, res, next) => { + console.log( + `${req.protocol}://${req.get('host')}${ + req.originalUrl + }: ${moment().format()}` + ); + next(); +}; + +module.exports = logger; |