25 lines
777 B
TypeScript
25 lines
777 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { AppModule } from './app.module';
|
|
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
|
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AppModule);
|
|
|
|
const config = new DocumentBuilder()
|
|
.setTitle('Documentacion de la api de votaciones_mails v2')
|
|
.setDescription(
|
|
'El proyecto ha sido refactorizado a una version mejorada con nestjs',
|
|
)
|
|
.setVersion('1.0')
|
|
.addTag('description')
|
|
.build();
|
|
const document = SwaggerModule.createDocument(app, config);
|
|
SwaggerModule.setup('documentation', app, document);
|
|
|
|
await app.listen(process.env.PORT ?? 3000);
|
|
|
|
console.log(`Aplicación corriendo en: http://localhost:${process.env.PORT ?? 3000}`);
|
|
}
|
|
bootstrap();
|