import { NestFactory } from '@nestjs/core' ; import { DocumentBuilder , SwaggerModule } from '@nestjs/swagger' ; import { HttpExceptionFilter } from './common/filters/http-exception.filter' ; import { ValidationPipe } from './common/pipes/validation.pipe' ; import { LoggingInterceptor } from './common/interceptors/logging.interceptor' ; import { AppModule } from './app.module' ; async function bootstrap ( ) { const app = await NestFactory . create ( AppModule ) ; app . useGlobalFilters ( new HttpExceptionFilter ( ) ) ; const swaggerOptions = new DocumentBuilder ( ) . setTitle ( 'nest-starter api document' ) . setDescription ( 'nest starter project api document' ) . setVersion ( '1.0' ) . addBearerAuth ( ) . build ( ) ; const document = SwaggerModule . createDocument ( app , swaggerOptions ) ; SwaggerModule . setup ( 'doc' , app , document ) ; await app . listen ( 3000 ) ; } bootstrap ( ) ;