Remove body-parser dependency (#7176)

This PR addresses issue #7158 by removing the body-parser dependency in
favor of express.json() and other built-in middleware functionalities
provided by Express.js.
This commit is contained in:
Atharva Rai
2024-12-06 22:17:06 +05:30
committed by GitHub
parent 3aff85a216
commit a3c64dc4dc
5 changed files with 9 additions and 14 deletions

4
app.ts
View File

@@ -29,7 +29,6 @@ import process from 'process';
import url from 'url';
import * as Sentry from '@sentry/node';
import bodyParser from 'body-parser';
import compression from 'compression';
import express from 'express';
import fs from 'fs-extra';
@@ -525,6 +524,7 @@ async function main() {
// Initialise express and then sentry. Sentry as early as possible to catch errors during startup.
const webServer = express(),
router = express.Router();
SetupSentry(aws.getConfig('sentryDsn'), ceProps, releaseBuildNumber, gitReleaseName, defArgs);
startWineInit();
@@ -848,7 +848,7 @@ async function main() {
),
);
})
.use(bodyParser.json({limit: ceProps('bodyParserLimit', maxUploadSize)}))
.use(express.json({limit: ceProps('bodyParserLimit', maxUploadSize)}))
.use(siteTemplateController.createRouter())
.use(sourceController.createRouter())
.use(assemblyDocumentationController.createRouter())