Skip to content

Commit

Permalink
Fix PayloadTooLargeError (#2192)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekBodingerBA authored Jan 31, 2025
1 parent 52faf5f commit c5e0105
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nest-forms-backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ValidationPipe } from '@nestjs/common'
import { NestFactory } from '@nestjs/core'
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'
import express from 'express'
import express, { json } from 'express'

import AppModule from './app.module'
import { INNOVATION_MAIL } from './utils/constants'
Expand Down Expand Up @@ -40,6 +40,9 @@ async function bootstrap(): Promise<void> {
)
app.useGlobalFilters(new ErrorFilter()) // This filter must be first
app.useGlobalFilters(new HttpExceptionFilter())
// https://stackoverflow.com/a/59978098
app.use(json({ limit: '50mb' }))

const config = new DocumentBuilder()
.setTitle('Nest Forms Backend')
.setDescription('Backend od processing forms and handling the attachments')
Expand Down

0 comments on commit c5e0105

Please sign in to comment.