From fdf96bb51ddaade6e6b09fca32f6f6da16db3373 Mon Sep 17 00:00:00 2001 From: 0fatal <72899968+0fatal@users.noreply.github.com> Date: Fri, 1 Mar 2024 15:35:32 +0800 Subject: [PATCH] fix(server): fix too large entity error when upload large func (#1882) --- server/src/main.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main.ts b/server/src/main.ts index f842f62b..5bed954f 100644 --- a/server/src/main.ts +++ b/server/src/main.ts @@ -7,6 +7,7 @@ import { ServerConfig } from './constants' import { InitializerService } from './initializer/initializer.service' import { SystemDatabase } from './system-database' import * as helmet from 'helmet' +import * as bodyParser from 'body-parser' async function bootstrap() { await SystemDatabase.ready @@ -31,6 +32,7 @@ async function bootstrap() { app.use(compression()) app.use(helmet.hidePoweredBy()) + app.use(bodyParser.json({ limit: '1mb' })) // for swagger api const config = new DocumentBuilder()