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();