import { ValidationPipe } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.useGlobalPipes(new ValidationPipe()); const options = new DocumentBuilder() .setTitle(`Res'in`) .setDescription(`Res'in API documentation`) .setVersion('1.0') .addBearerAuth({ type: 'http', scheme: 'bearer', bearerFormat: 'JWT' }, 'JWT') .build(); const document = SwaggerModule.createDocument(app, options); SwaggerModule.setup('doc', app, document); app.setGlobalPrefix('api'); await app.listen(3000); } bootstrap();