Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Configure morgan so that it also shows the data sent in HTTP POST requests:

morgan.token('body', (req, res) => JSON.stringify(req.body));
app.use(morgan(':method :url :status :res[content-length] :response-time ms - :body - :req[content-length]'));
 
PREVIOUS NEXT
Tagged: #Configure #morgan #shows #data #HTTP #POST
ADD COMMENT
Topic
Name
5+7 =