aboutsummaryrefslogtreecommitdiffstats
path: root/index.js
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2019-04-17 21:59:22 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2019-04-17 21:59:22 -0500
commite719de425d7607368d530373002d8f550747fb79 (patch)
tree6fd650012b1859030f9501af3b2ace62d659ecb6 /index.js
parentfda25494564015e0fdaa7742746ca0fbb7185f80 (diff)
Install moment and utilize it in logger to add timestamp after url.
Diffstat (limited to 'index.js')
-rw-r--r--index.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/index.js b/index.js
index 07d9a16..4721f34 100644
--- a/index.js
+++ b/index.js
@@ -1,13 +1,18 @@
const express = require('express');
const path = require('path');
const members = require('./Members.js');
+const moment = require('moment');
const app = express();
const logger = (req, res, next) => {
- console.log(`${req.protocol}://${req.get('host')}${req.originalUrl}`);
+ console.log(
+ `${req.protocol}://${req.get('host')}${
+ req.originalUrl
+ }: ${moment().format()}`
+ );
next();
-}
+};
// Init middleware
app.use(logger);