Skip to content

Commit

Permalink
✨ Added swagger base path to .env
Browse files Browse the repository at this point in the history
  • Loading branch information
ICEatm committed Jun 20, 2024
1 parent 7ed8f94 commit f02b7c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f02b7c2

Please sign in to comment.