오류상황 : npm 으로 설치한 body-parser를 이용해 input에서 post 요청시에
함께 보내지는 name속성과 해당 값을 받기 위해 파싱하려고 하였다.
app.use(bodyParser({extended : true}))
위와 같이 body-parser를 메서드로 오류없이 이용하기 위해 extended : true속성을 전달하려 했으나,
express bodyparser deprecated라는 오류와 함께 bodyParser 같은 줄이 그어졌다.
참고 사이트 : https://stackoverflow.com/questions/24330014/bodyparser-is-deprecated-express-4
bodyParser is deprecated express 4
I am using express 4.0 and I'm aware that body parser has been taken out of the express core, I am using the recommended replacement, however I am getting body-parser deprecated bodyParser: use
stackoverflow.com
위의 스택오버플로우에 의하면 2014-06-19부로 삭제되었으며,
express 4.16.0버전 이상을 사용할 시
express.json() 혹은 express.urlencoded()
라는 메서드로 추가되었다고 한다.
그러므로 사용하려면
app.use(express.urlencoded({extended : true}))
와 같이 직접 express.urelencoded를 사용하면 된다.