feat: prefix all apis

This commit is contained in:
Abdalhamid Alhamad
2025-01-05 14:46:49 +03:00
parent 084d39096c
commit 25ef549417

View File

@ -1,4 +1,4 @@
import { INestApplication } from '@nestjs/common'; import { INestApplication, RequestMethod } from '@nestjs/common';
import { ConfigService } from '@nestjs/config'; import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core'; import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
@ -17,6 +17,12 @@ async function bootstrap() {
preflightContinue: false, preflightContinue: false,
optionsSuccessStatus: 204, optionsSuccessStatus: 204,
}); });
app.setGlobalPrefix('api', {
exclude: [
{ path: 'health', method: RequestMethod.GET },
{ path: 'health/details', method: RequestMethod.GET },
],
});
const config = app.get(ConfigService); const config = app.get(ConfigService);
const swaggerDocument = await createSwagger(app); const swaggerDocument = await createSwagger(app);