increase body limit

This commit is contained in:
faris Aljohari
2024-07-15 15:51:02 +03:00
parent 45d46cee2a
commit f8cd47e940

View File

@ -4,6 +4,7 @@ import rateLimit from 'express-rate-limit';
import helmet from 'helmet';
import { setupSwaggerAuthentication } from '../libs/common/src/util/user-auth.swagger.utils';
import { ValidationPipe } from '@nestjs/common';
import { json, urlencoded } from 'body-parser';
import { SeederService } from '@app/common/seed/services/seeder.service';
async function bootstrap() {
@ -11,6 +12,10 @@ async function bootstrap() {
app.enableCors();
// Set the body parser limit to 1 MB
app.use(json({ limit: '1mb' }));
app.use(urlencoded({ limit: '1mb', extended: true }));
app.use(
rateLimit({
windowMs: 5 * 60 * 1000,
@ -42,7 +47,8 @@ async function bootstrap() {
} catch (error) {
console.error('Seeding failed!', error);
}
console.log('Starting auth at port ...', process.env.PORT || 4000);
await app.listen(process.env.PORT || 4000);
}
console.log('Starting auth at port ...', process.env.PORT || 4000);
bootstrap();