mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 21:23:45 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user