From e0cd893ace51084c9feb9186ced8d8ed4a517cd2 Mon Sep 17 00:00:00 2001 From: niksbanna Date: Tue, 7 Jan 2025 18:42:38 +0530 Subject: [PATCH] swagger changes --- src/main.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.ts b/src/main.ts index 00b405f..2749fc8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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 @@ -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({