Commit 07f301e4 authored by Diego Iván's avatar Diego Iván
Browse files

agregando swagger a la app

parent 239ffe7a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ServerConstants } from './constants/server.contants';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  const config = new DocumentBuilder()
    .setTitle('Pueblos Magicos API')
    .setVersion('1.0')
    .build();
  const document = SwaggerModule.createDocument(app, config);
  SwaggerModule.setup('api', app, document);
  await app.listen(ServerConstants.PORT);
  console.log(`Application is running on: ${await app.getUrl()}`);
  console.log(`API documentation at: ${await app.getUrl()}/api`);
}
bootstrap();