You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
317 B
13 lines
317 B
import Logger from "../utils/logger.js";
|
|
|
|
|
|
export function addLogger(req, res, next) {
|
|
const endpoint = req.route.path;
|
|
const method = req.method;
|
|
const ip = req.connection.remoteAddress;
|
|
if (!req.body) {
|
|
req.body = {}
|
|
}
|
|
req.body.logger = new Logger(method, endpoint, ip);
|
|
next()
|
|
}
|