mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 13:34:54 +00:00
increase body limit
This commit is contained in:
@ -4,6 +4,7 @@ import rateLimit from 'express-rate-limit';
|
|||||||
import helmet from 'helmet';
|
import helmet from 'helmet';
|
||||||
import { setupSwaggerAuthentication } from '../libs/common/src/util/user-auth.swagger.utils';
|
import { setupSwaggerAuthentication } from '../libs/common/src/util/user-auth.swagger.utils';
|
||||||
import { ValidationPipe } from '@nestjs/common';
|
import { ValidationPipe } from '@nestjs/common';
|
||||||
|
import { json, urlencoded } from 'body-parser';
|
||||||
import { SeederService } from '@app/common/seed/services/seeder.service';
|
import { SeederService } from '@app/common/seed/services/seeder.service';
|
||||||
|
|
||||||
async function bootstrap() {
|
async function bootstrap() {
|
||||||
@ -11,6 +12,10 @@ async function bootstrap() {
|
|||||||
|
|
||||||
app.enableCors();
|
app.enableCors();
|
||||||
|
|
||||||
|
// Set the body parser limit to 1 MB
|
||||||
|
app.use(json({ limit: '1mb' }));
|
||||||
|
app.use(urlencoded({ limit: '1mb', extended: true }));
|
||||||
|
|
||||||
app.use(
|
app.use(
|
||||||
rateLimit({
|
rateLimit({
|
||||||
windowMs: 5 * 60 * 1000,
|
windowMs: 5 * 60 * 1000,
|
||||||
@ -42,7 +47,8 @@ async function bootstrap() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Seeding failed!', error);
|
console.error('Seeding failed!', error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('Starting auth at port ...', process.env.PORT || 4000);
|
||||||
await app.listen(process.env.PORT || 4000);
|
await app.listen(process.env.PORT || 4000);
|
||||||
}
|
}
|
||||||
console.log('Starting auth at port ...', process.env.PORT || 4000);
|
|
||||||
bootstrap();
|
bootstrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user