Merge pull request #33361 from overleaf/copilot/remove-direct-use-of-body-parser

Remove direct use of body-parser in favour of express built-ins

GitOrigin-RevId: 656c5f216daf68e86d53ae07d272e080bd5ab27f
This commit is contained in:
Lucie Germain
2026-09-17 11:14:46 +00:00
committed by Copybot
parent 6be5db7667
commit 210ced0d31
25 changed files with 24 additions and 65 deletions
-1
View File
@@ -15,7 +15,6 @@
"license": "AGPL-3.0-only",
"devDependencies": {
"@types/node-fetch": "^2.6.13",
"body-parser": "1.20.4",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"express": "4.22.1",
@@ -1,5 +1,4 @@
const express = require('express')
const bodyParser = require('body-parser')
const { EventEmitter } = require('node:events')
const http = require('node:http')
const https = require('node:https')
@@ -10,7 +9,7 @@ class TestServer {
this.app = express()
this.events = new EventEmitter()
this.app.use(bodyParser.json())
this.app.use(express.json())
this.app.use((req, res, next) => {
this.events.emit('request-received')
this.lastReq = req