728x90 nodejs post data1 [NodeJs] 미들웨어 body-parser 설치 없이 get, post 데이터 손쉽게 다루기 NodeJS body-parser 설치 없이 웹 get,post 데이터 손쉽게 다루기 express 4.x 이전 버전에서는 body-parser를 npm install body-parser 를 통해 설치 후 사용하였다. 하지만 4.x버전 이후에서는 따로 body-parser를 설치하지 않아도, 기존 body-parser의 기능이 express내에 탑재되어있어 하단의 코드와 같이 작성하면 해당 기능을 사용할수 있다. //최소한의 코드로 설명 const express = require('express'); const app = express(); //기존에는 require('bodyParser') 추가 후 //bodyParser.json()이었음.. app.use(express.urlencoded({exte.. 2021. 3. 25. 이전 1 다음 728x90