To accept form data request with Node Express.js, we use the body-parser
module.
For instance, we write
const bodyParser = require("body-parser");
app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(bodyParser.urlencoded({ extended: true }));
to call bodyParser.urlencoded
to add a middleware to accept form data requests.