aboutsummaryrefslogtreecommitdiffstats
path: root/middleware/logger.js
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/logger.js')
-rw-r--r--middleware/logger.js12
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;