From 8af8c8d6df6cbeaafeb504fb4b8cbfbcbf38db72 Mon Sep 17 00:00:00 2001 From: Soheil Hajizadeh Date: Sun, 5 Jul 2026 11:52:32 +0330 Subject: [PATCH] fixed --- src/main.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main.ts b/src/main.ts index ecd1298..d57a41a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -59,7 +59,9 @@ async function bootstrap(): Promise { }), ); - const swaggerConfig = new DocumentBuilder() + const baseUrlProd = process.env.BASE_URL_PROD; + + const documentBuilder = new DocumentBuilder() .setTitle('External Services Gateway') .setDescription( 'Unified gateway for external inquiry providers with JWT authentication, RBAC, ' + @@ -67,8 +69,13 @@ async function bootstrap(): Promise { ) .setVersion('1.0') .addServer("http://localhost:8085") - .addServer("https://apex.mic.co.ir/esg/api") - .addServer(process.env.BASE_URL_PROD) + .addServer("https://apex.mic.co.ir/esg/api"); + + if (baseUrlProd) { + documentBuilder.addServer(baseUrlProd); + } + + const swaggerConfig = documentBuilder .addBearerAuth( { type: 'http', scheme: 'bearer', bearerFormat: 'JWT', in: 'header' }, 'bearer',