Skip to content

Commit

Permalink
Remove unnecessary body-parser (#52580)
Browse files Browse the repository at this point in the history
Since the `body-parser`  middleware is already built-in `express.js` after v4.16.0, so we can clean some code
  • Loading branch information
suhaotian committed Jul 12, 2023
1 parent b89424e commit 4c4bee7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 82 deletions.
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -111,7 +111,6 @@
"amphtml-validator": "1.0.35",
"ansi-escapes": "4.3.2",
"async-sema": "3.0.1",
"body-parser": "1.20.1",
"browserslist": "4.20.2",
"buffer": "5.6.0",
"chalk": "5.0.1",
Expand Down
79 changes: 0 additions & 79 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions test/integration/api-body-parser/server.js
@@ -1,5 +1,4 @@
const next = require('next')
const bodyParser = require('body-parser')
const express = require('express')

const dev = process.env.NODE_ENV !== 'production'
Expand All @@ -12,7 +11,7 @@ const handleNextRequests = app.getRequestHandler()
app.prepare().then(() => {
const server = express()

server.use(bodyParser.json({ limit: '5mb' }))
server.use(express.json({ limit: '5mb' }))

server.all('*', (req, res) => {
handleNextRequests(req, res)
Expand Down

0 comments on commit 4c4bee7

Please sign in to comment.