how to log bodyparser error code example
Example: how to log bodyparser error
app.use(bodyParser.json())
app.use((err, req, res, next) => {
if (err) {
console.log('Invalid Request data', err)
res.status(400).send('Invalid Request data')
} else {
next()
}
})