mirror of
https://github.com/dadosfera/maestro.git
synced 2026-08-31 19:58:21 +00:00
FIX: better swagger generation strategy (Only PRD server on external docs)
This commit is contained in:
+7
-6
@@ -42,7 +42,7 @@ function configureSwagger(app: INestApplication) {
|
||||
}
|
||||
const swaggerTitle = branchName ? `Maestro - ${branchName}` : 'Maestro';
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
const swaggerConfig = new DocumentBuilder()
|
||||
.setTitle(swaggerTitle)
|
||||
.setDescription('Documentation for Maestro gateway')
|
||||
.addSecurity('access-token', {
|
||||
@@ -50,11 +50,12 @@ function configureSwagger(app: INestApplication) {
|
||||
name: 'Authorization',
|
||||
in: 'header',
|
||||
})
|
||||
.setDescription('This is the Maestro API')
|
||||
.addServer('https://maestro.stg.dadosfera.ai', 'Ambiente STG')
|
||||
.addServer('https://maestro-2.stg.dadosfera.ai', 'Ambiente STG2')
|
||||
.addServer('https://maestro.dadosfera.ai', 'Ambiente PRD')
|
||||
.build();
|
||||
.setDescription('This is the Maestro API');
|
||||
|
||||
if (process.env.INTERNAL_SWAGGER !== 'true')
|
||||
swaggerConfig.addServer('https://maestro.dadosfera.ai', 'Dadosfera API');
|
||||
|
||||
const config = swaggerConfig.build();
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user