From 6716e0547bd432e8d6fc0a42e1a3c303e60b1e1c Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 27 Feb 2024 16:13:09 +0100 Subject: [PATCH] fix --- apps/policy-engine/src/main.ts | 17 +---------------- package-lock.json | 1 - package.json | 1 - 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/apps/policy-engine/src/main.ts b/apps/policy-engine/src/main.ts index d1b4433a1..9c69e1132 100644 --- a/apps/policy-engine/src/main.ts +++ b/apps/policy-engine/src/main.ts @@ -2,7 +2,6 @@ import { INestApplication, Logger, ValidationPipe } from '@nestjs/common' import { ConfigService } from '@nestjs/config' import { NestFactory } from '@nestjs/core' import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger' -import { json, urlencoded } from 'express' import { lastValueFrom, map, of, switchMap } from 'rxjs' import { AppModule } from './app/app.module' @@ -38,21 +37,9 @@ const withGlobalPipes = (app: INestApplication): INestApplication => { return app } -const withJsonBodyParser = (app: INestApplication): INestApplication => { - app.use(json({ limit: '50mb' })) - - return app -} - -const withUrlEncoded = (app: INestApplication): INestApplication => { - app.use(urlencoded({ extended: true, limit: '50mb' })) - - return app -} - async function bootstrap() { const logger = new Logger('AuthorizationNodeBootstrap') - const application = await NestFactory.create(AppModule) + const application = await NestFactory.create(AppModule, { bodyParser: true }) const configService = application.get(ConfigService) const port = configService.get('PORT') @@ -64,8 +51,6 @@ async function bootstrap() { of(application).pipe( map(withSwagger), map(withGlobalPipes), - map(withJsonBodyParser), - map(withUrlEncoded), switchMap((app) => app.listen(port)) ) ) diff --git a/package-lock.json b/package-lock.json index 49cdb2d24..a3ab49499 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,6 @@ "class-validator": "^0.14.1", "clsx": "^1.2.1", "date-fns": "^3.3.1", - "express": "^4.18.2", "handlebars": "^4.7.8", "jose": "^5.2.1", "lodash": "^4.17.21", diff --git a/package.json b/package.json index 92e225af5..d6f56216a 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,6 @@ "class-validator": "^0.14.1", "clsx": "^1.2.1", "date-fns": "^3.3.1", - "express": "^4.18.2", "handlebars": "^4.7.8", "jose": "^5.2.1", "lodash": "^4.17.21",