in server.js file i have added the below code from ref. it gives me req.body as expected. but is it possible to log the response.body as well? how. i tried to print the res.body it gives me long object of response but not actual response body.
app.middleware('initial', function logResponse(req, res, next) {
// install a listener for when the response is finished
res.on('finish', function() {
// the request was handled, print the log entry
console.log(res.body, req.originalUrl, res.statusCode);
});
// resume the routing pipeline,
// let other middleware to actually handle the request
next();
});