Skip to content

Commit

Permalink
swagger changes
Browse files Browse the repository at this point in the history
  • Loading branch information
niksbanna committed Jan 7, 2025
1 parent 0a5e0c7 commit e0cd893
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import helmet from 'helmet';
import rateLimit from 'express-rate-limit';
import { AppModule } from "./modules/app/app.module";
import { ValidationPipe } from "@nestjs/common";
import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";

/**
* The url endpoint for open api ui
Expand Down Expand Up @@ -30,6 +31,14 @@ export const SWAGGER_API_CURRENT_VERSION = "1.0";
abortOnError: false,
bufferLogs: false,
});
const options = new DocumentBuilder()
.setTitle(SWAGGER_API_NAME)
.setDescription(SWAGGER_API_DESCRIPTION)
.setVersion(SWAGGER_API_CURRENT_VERSION)
.addBearerAuth()
.build();
const document = SwaggerModule.createDocument(app, options);
SwaggerModule.setup(SWAGGER_API_ROOT, app, document);
app.use(helmet());
app.use(
rateLimit({
Expand Down

0 comments on commit e0cd893

Please sign in to comment.