Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Feb 26, 2024
1 parent 1926267 commit f4bcf8b
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions apps/policy-engine/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ 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)
Expand All @@ -52,11 +64,8 @@ async function bootstrap() {
of(application).pipe(
map(withSwagger),
map(withGlobalPipes),
map((app) => {
app.use(json({ limit: '50mb' }))
app.use(urlencoded({ extended: true, limit: '50mb' }))
return app
}),
map(withJsonBodyParser),
map(withUrlEncoded),
switchMap((app) => app.listen(port))
)
)
Expand Down

0 comments on commit f4bcf8b

Please sign in to comment.