Files
maestro/src/main.ts
T
2022-02-02 12:27:02 -03:00

25 lines
706 B
TypeScript

import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { writeFileSync } from 'fs';
import { AppModule } from './app.module';
require("dotenv").config();
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const config = new DocumentBuilder()
.setTitle('Maestro Grpc Documentation')
.setDescription('Documentation for Maestro gateway')
.setVersion('1.0')
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, config);
writeFileSync('./swagger.json', JSON.stringify(document));
SwaggerModule.setup('api', app, document);
await (await app).listen(3000);
}
bootstrap();