Skip to content
This repository was archived by the owner on Feb 8, 2025. It is now read-only.

Commit a561472

Browse files
authored
Merge pull request #297 from zallo-labs/Z-348-max-body-size
fix(api): increase max request body size
2 parents 5d4408a + 3a67100 commit a561472

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/src/main.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { AppModule } from './app.module';
55
import { Logger } from '@nestjs/common';
66
import { CONFIG, LogLevel } from '~/config';
77
import { GQL_ENDPOINT } from './core/apollo/apollo.module';
8+
import { NestExpressApplication } from '@nestjs/platform-express';
89

910
async function bootstrap() {
10-
const app = await NestFactory.create(AppModule, {
11+
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
1112
logger: [...Object.values(LogLevel).slice(Object.values(LogLevel).indexOf(CONFIG.logLevel))],
1213
});
1314

@@ -17,6 +18,7 @@ async function bootstrap() {
1718
credentials: true,
1819
maxAge: 7200 /* 2 hours */,
1920
});
21+
app.useBodyParser('json', { limit: '1mb' });
2022

2123
await app.listen(CONFIG.apiPort);
2224
Logger.debug(`${await app.getUrl()}${GQL_ENDPOINT}`);

0 commit comments

Comments
 (0)