1The package bodyParser is deprecated. You will get this warning with these lines of code:
2
3app.use(bodyparser.json());
4app.use(bodyParser.urlencoded({extended: true}));
5
6If you are using Express 4.16+ you can now replace those lines with:
7
8app.use(express.json());
9app.use(express.urlencoded()); //Parse URL-encoded bodies
1const express = require('express');
2
3app.use(express.urlencoded({ extended: true }));
4app.use(express.json());
5
1// bodyParsor is deprecated, most of the functionality is included in express
2// on epxress 4.16 and above just replace bodyParser with express
3// e.g
4const express = require('express')
5app.use(express.urlencoded({extended: true}));
1const bodyParser = require('body-parser');
2
3app.use(bodyParser.urlencoded({ extended: true }));
4app.use(bodyParser.json());
5
1app.use(express.urlencoded({extended: true}));
2app.use(express.json()) // To parse the incoming requests with JSON payloads