Node.js/express.js

import bodyParser from "body-parser";

Dev갱이 2021. 4. 27. 16:38
728x90

express.js 버전 4.16.1

 

npm install body-parser 이후

const bodyParser = require('body-parser');

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

bodypaser에 줄이 그어져있으면서 
'bodyParser' is deprecated.ts(6385)

왜 body-parser가 안되누...

 

medium.com/@mmajdanski/express-body-parser-and-why-may-not-need-it-335803cd048c

 

Express — body-parser and why may not need it

Express 4.16+ gets rid of your additional body-parser dependency

medium.com

 

4.16.1이상부터는 걍 bardyparser 읎써도 된다고 하네...?

You might not need to install the additional body-parser package to your application if you are using Express 4.16+. There are many tutorials that include the installation of body-parser because they are dated prior to the release of Express 4.16.

728x90