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