22 lines
679 B
TypeScript
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();
|