@@ -8,6 +8,8 @@ import { ApiModule } from './api/api.module';
8
8
import { LoggerService } from './shared/modules/global/logger.service' ;
9
9
import { Response } from 'express' ;
10
10
11
+ const API_PREFIX = '/v6/review' ; // Global prefix for all routes in production
12
+
11
13
async function bootstrap ( ) {
12
14
const app = await NestFactory . create < NestExpressApplication > ( AppModule , {
13
15
rawBody : true ,
@@ -17,10 +19,10 @@ async function bootstrap() {
17
19
// Create logger instance for application bootstrap
18
20
const logger = LoggerService . forRoot ( 'Bootstrap' ) ;
19
21
20
- // Global prefix for all routes in production is configured as `/v6/review`
22
+ // Global prefix for all routes in production
21
23
if ( process . env . NODE_ENV === 'production' ) {
22
- app . setGlobalPrefix ( '/v6/review' ) ;
23
- logger . log ( ' Setting global prefix to /v6/review in production mode' ) ;
24
+ app . setGlobalPrefix ( API_PREFIX ) ;
25
+ logger . log ( ` Setting global prefix to ${ API_PREFIX } in production mode` ) ;
24
26
}
25
27
26
28
// CORS related settings
@@ -142,7 +144,7 @@ async function bootstrap() {
142
144
const document = SwaggerModule . createDocument ( app , config , {
143
145
include : [ ApiModule ] ,
144
146
} ) ;
145
- SwaggerModule . setup ( '/v5/review/ api-docs' , app , document ) ;
147
+ SwaggerModule . setup ( ` ${ API_PREFIX } / api-docs` , app , document ) ;
146
148
logger . log ( 'Swagger documentation configured' ) ;
147
149
148
150
// Add an event handler to log uncaught promise rejections and prevent the server from crashing
0 commit comments