From f02b7c264e60bc93d61ff751239834c31d854e5e Mon Sep 17 00:00:00 2001 From: ICEatm Date: Thu, 20 Jun 2024 14:28:57 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Added=20swagger=20base=20path=20to?= =?UTF-8?q?=20.env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 1 + src/main.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 3b8a445..903984a 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,5 @@ PREFIX=api # Swagger Options SWAGGER_TITLE="NestJS Template by ICEatm - Swagger" SWAGGER_VERSION="1.0" +SWAGGER_BASE_PATH="docs" SWAGGER_DESCRIPTION="A simple Swagger Instance" \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index 9a034e4..2844a53 100644 --- a/src/main.ts +++ b/src/main.ts @@ -71,7 +71,7 @@ async function bootstrap() { .build(); const swaggerDocument = SwaggerModule.createDocument(app, swaggerConfig); - SwaggerModule.setup('docs', app, swaggerDocument); + SwaggerModule.setup((process.env.SWAGGER_BASE_PATH as string ?? '/docs'), app, swaggerDocument); }; setupSwagger(app);