메모용 개발 블로그
  • Home

Categories

  • All Posts116
  • OS35
    • Linux23
    • MacOS8
    • Windows4
  • 데이터베이스3
    • Oracle1
    • Postgresql1
  • Develop26
    • CSS33
    • Go8
    • HTML52
    • Java1
    • JavaScript4
    • React2
    • Svelte2
  • 개발일기10
  • Docker1
  • Git3
  • GitLab12
  • Nginx7
  • 기타16
  • 이 블로그의 오픈소스3
Develop•2022년 3월 31일

Express BodyParser Deprecated

Table of Contents

  • Express BodyParser Deprecated

예전 프로젝트를 불러와서 의존성 패키지를 설치하고 프로젝트를 보니 다음과 같이 나와있다.

image-20220308205332584

해당 에러 메시지를 보면

‘bodyParser’ is deprecated. 라고 되어 있는데.

모종의 이유로 해당 기능이 사용이 되지 않는다는 것.

원인은 Express 4.16 버전 이후로는 bodyParser가 내장되었으므로 이를 사용하라는 것이다.

좋은 이유이니 위 코드는 다음과 같이 수정하면 된다.

this.app.use(express.json());
this.app.use(bodyParser.urlencoded({ extended: false}));
← Back to all posts