13 lines
278 B
JavaScript
13 lines
278 B
JavaScript
|
'use strict'
|
||
|
|
||
|
const { logMessage } = require("../lib/logger")
|
||
|
|
||
|
// Dependencies
|
||
|
|
||
|
const logRoute = async (req, res, next) => {
|
||
|
logMessage(`${req.originalUrl}`, `\nHeaders: ${JSON.stringify(req.headers)}\nBody: ${JSON.stringify(req.body)}`)
|
||
|
next()
|
||
|
}
|
||
|
|
||
|
module.exports = logRoute
|