CodeCards/backend/middleware/logger.js

11 lines
311 B
JavaScript
Raw Normal View History

2024-08-04 17:23:21 +00:00
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;