Тестовый коммит после удаления husky
This commit is contained in:
12
backend/middleware/logger.js
Normal file
12
backend/middleware/logger.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const logger = (req, res, next) => {
|
||||
const start = Date.now();
|
||||
|
||||
res.on('finish', () => {
|
||||
const duration = Date.now() - start;
|
||||
console.log(`${req.method} ${req.originalUrl} - ${res.statusCode} - ${duration}ms`);
|
||||
});
|
||||
|
||||
next();
|
||||
};
|
||||
|
||||
module.exports = logger;
|
||||
Reference in New Issue
Block a user