Files
backend/apps/auth/src/main.ts
2024-02-26 11:23:44 +05:30

33 lines
687 B
TypeScript

import { NestFactory } from '@nestjs/core';
import { AuthModule } from './auth.module';
import rateLimit from 'express-rate-limit';
import helmet from 'helmet';
import { setupSwaggerAuthentication } from '@app/common/util/user-auth.swagger.utils';
import { ValidationPipe } from '@nestjs/common';
async function bootstrap() {
const app = await NestFactory.create(AuthModule);
app.enableCors();
app.use(
rateLimit({
windowMs: 5 * 60 * 1000,
max: 500,
}),
);
app.use(
helmet({
contentSecurityPolicy: false,
}),
);
setupSwaggerAuthentication(app);
app.useGlobalPipes(new ValidationPipe());
await app.listen(6001);
}
bootstrap();