fix(server): increase json body payload limit (#941)

This commit is contained in:
Jason Rasmussen 2022-11-08 10:24:49 -05:00 committed by GitHub
parent fe4b307fe6
commit 8a9b0347bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,12 +8,14 @@ import path from 'path';
import { AppModule } from './app.module'; import { AppModule } from './app.module';
import { serverVersion } from './constants/server_version.constant'; import { serverVersion } from './constants/server_version.constant';
import { RedisIoAdapter } from './middlewares/redis-io.adapter.middleware'; import { RedisIoAdapter } from './middlewares/redis-io.adapter.middleware';
import { json } from 'body-parser';
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule); const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.set('trust proxy'); app.set('trust proxy');
app.use(cookieParser()); app.use(cookieParser());
app.use(json({ limit: '10mb' }));
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
app.enableCors(); app.enableCors();
} }