merge with main

This commit is contained in:
rodrigo.zamboni
2022-06-29 12:28:00 -03:00
51 changed files with 4704 additions and 1168 deletions
+9 -2
View File
@@ -4,6 +4,9 @@ import apm from 'elastic-apm-node';
import { writeFileSync } from 'fs';
import helmet from 'helmet';
import { DadosferaLogger } from 'dadosfera-logs';
import documentEmpty from '../swagger_empty.json';
import { AppModule } from './app.module';
async function bootstrap() {
@@ -46,7 +49,7 @@ async function bootstrap() {
app.use(helmet());
const config = new DocumentBuilder()
.setTitle('Maestro Grpc Documentation')
.setTitle('Maestro')
.setDescription('Documentation for Maestro gateway')
.setVersion('1.0')
.addBearerAuth()
@@ -54,7 +57,11 @@ async function bootstrap() {
const document = SwaggerModule.createDocument(app, config);
writeFileSync('./swagger.json', JSON.stringify(document));
SwaggerModule.setup('api', app, document);
if (process.env.ENV != 'stg' && process.env.ENV != 'prd')
SwaggerModule.setup('api', app, document);
const swaggerDoc = process.env.ENV === 'dev' ? document : documentEmpty;
SwaggerModule.setup('api', app, swaggerDoc);
await app.listen(3333);
}