From 25ef549417dc7394cee8f2a498f8510ac30c5bd3 Mon Sep 17 00:00:00 2001 From: Abdalhamid Alhamad Date: Sun, 5 Jan 2025 14:46:49 +0300 Subject: [PATCH] feat: prefix all apis --- src/main.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index b4f2e01..db6f7bf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,4 +1,4 @@ -import { INestApplication } from '@nestjs/common'; +import { INestApplication, RequestMethod } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { NestFactory } from '@nestjs/core'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; @@ -17,6 +17,12 @@ async function bootstrap() { preflightContinue: false, optionsSuccessStatus: 204, }); + app.setGlobalPrefix('api', { + exclude: [ + { path: 'health', method: RequestMethod.GET }, + { path: 'health/details', method: RequestMethod.GET }, + ], + }); const config = app.get(ConfigService); const swaggerDocument = await createSwagger(app);