main.ts 764 B

12345678910111213141516171819202122232425
  1. import { NestFactory } from '@nestjs/core';
  2. import { ValidationPipe } from '@nestjs/common';
  3. import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
  4. import helmet from 'helmet';
  5. import { AppModule } from './app.module';
  6. async function bootstrap() {
  7. const app = await NestFactory.create(AppModule);
  8. app.use(helmet());
  9. app.enableCors();
  10. app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
  11. const config = new DocumentBuilder()
  12. .setTitle('Arrival MANager')
  13. .setDescription('The AMAN Rest-API to plan arrival sequences')
  14. .setVersion('0.1.0')
  15. .addTag('aman')
  16. .build();
  17. const document = SwaggerModule.createDocument(app, config);
  18. SwaggerModule.setup('api', app, document);
  19. await app.listen(3000);
  20. }
  21. bootstrap();