Files
pcpuma_unam_api/src/main.ts
T
2022-05-31 13:04:59 -05:00

22 lines
679 B
TypeScript

import { NestFactory } from '@nestjs/core';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const config = new DocumentBuilder()
.setTitle('pcpuma_unam_api')
.setDescription('Api de Pc puma')
.setVersion('1.0')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('/api', app, document);
app.useGlobalPipes(new ValidationPipe({ whitelist: true }));
app.enableCors();
await app.listen(process.env.API_PORT);
}
bootstrap();