import { NestFactory } from '@nestjs/core'; import { ValidationPipe } from '@nestjs/common'; import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; import { AppModule } from './app.module'; import { NormalizeDatesInterceptor } from './common/normalize-dates.interceptor'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.useGlobalInterceptors(new NormalizeDatesInterceptor()); app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true })); app.enableCors(); const config = new DocumentBuilder() .setTitle('med API') .setDescription('Auto-generated CRUD API for med') .setVersion('1.0') .addBearerAuth() .build(); const document = SwaggerModule.createDocument(app, config); SwaggerModule.setup('api/docs', app, document); await app.listen(3000); } bootstrap();