mirror of
https://github.com/dadosfera/maestro.git
synced 2026-10-13 21:39:07 +00:00
25 lines
706 B
TypeScript
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();
|