11 lines
311 B
JavaScript
11 lines
311 B
JavaScript
|
const express = require('express');
|
||
|
|
||
|
const Loggerware = express.Router();
|
||
|
|
||
|
Loggerware.use((req, res, next) => {
|
||
|
let time = new Date().toLocaleTimeString();
|
||
|
console.log(time + ' | Request received | path: ' + req.path + ' | method: ' + req.method);
|
||
|
next();
|
||
|
});
|
||
|
|
||
|
module.exports = Loggerware;
|