With the express upgrade, bodyParser from express is separated out, therefore, when using the new version express the need npm install body-parser to install bodyParser.
-
In app.js to be introduced bodyParser.
var bodyParser = require(‘body-parser‘);
-
Secondly, we need to use bodyParser in app.js in.
app.use(bodyParser());
-
Finally, the need to provide parameters to bodyParser.
‘Content-Type‘: ‘application/x-www-form-urlencoded‘
For the parameter bodyParser according to parse the file type to be provided, there are many types of parameters, can view the specific document.