import { NestFactory } from '@nestjs/core' ; import { AppModule } from './app.module' ; import { ValidationPipe } from '@nestjs/common' ; import { SwaggerModule , DocumentBuilder } from '@nestjs/swagger' ; import * as helmet from 'helmet' ; import * as rateLimit from 'express-rate-limit' ; async function bootstrap ( ) { const app = await NestFactory . create ( AppModule ) ; app . useGlobalPipes ( new ValidationPipe ( ) ) ; app . enableCors ( ) ; app . use ( helmet ( ) ) ; app . use ( rateLimit ( { windowMs : 10 * 60 * 1000 , max : 100 , } ) ) ; const options = new DocumentBuilder ( ) . setTitle ( 'Backend' ) . setDescription ( 'Full user authentication system with roles, sessions and email verification' ) . setVersion ( '1.0' ) . build ( ) ; const document = SwaggerModule . createDocument ( app , options ) ; SwaggerModule . setup ( 'api' , app , document ) ; await app . listen ( 3000 ) ; } bootstrap ( ) ;