1const express = require('express');
2
3app.use(express.urlencoded({ extended: true }));
4app.use(express.json());
5
1body-parser has been deprecated from express v4.*
2Use body-parser package instead.
3npm i body-parser
4
5import bodyParser from "body-parser";//for typscript code only, use require for js
6app.use(bodyParser.json());
7app.use(bodyParser.urlencoded({ extended: false }));