@@ -7,22 +7,32 @@ import { Request, Response } from 'express';
77import { LoggingInterceptor } from './common/interceptors/logging.interceptor' ;
88import { TransformInterceptor } from './common/interceptors/transform.interceptor' ;
99import { HttpExceptionFilter } from './common/filters/http-exception.filter' ;
10- import { LogsService } from './common/logs /logs.service' ;
10+ import { LogsService } from './common/logging /logs.service' ;
1111
1212async function bootstrap ( ) {
1313 const app = await NestFactory . create < NestExpressApplication > ( AppModule ) ;
1414 app . enableCors ( { origin : '*' , credentials : true } ) ;
15- app . useGlobalPipes ( new ValidationPipe ( { transform : true , transformOptions : { enableImplicitConversion : true } } ) ) ;
15+ app . useGlobalPipes (
16+ new ValidationPipe ( {
17+ transform : true ,
18+ transformOptions : { enableImplicitConversion : true } ,
19+ } ) ,
20+ ) ;
1621 const logs = app . get ( LogsService ) ;
17- app . useGlobalInterceptors ( new LoggingInterceptor ( logs ) , new TransformInterceptor ( ) ) ;
22+ app . useGlobalInterceptors (
23+ new LoggingInterceptor ( logs ) ,
24+ new TransformInterceptor ( ) ,
25+ ) ;
1826 app . useGlobalFilters ( new HttpExceptionFilter ( ) ) ;
1927 // Serve static UI from the project root "public" folder regardless of build output location
2028 const publicDir = join ( process . cwd ( ) , 'public' ) ;
2129 app . useStaticAssets ( publicDir ) ;
2230 const server = app . getHttpAdapter ( ) . getInstance ( ) ;
2331 // SPA fallback: exclude API routes
24- server . get ( / ^ (? ! \/ (?: a p i | u s e r s | b o o k s | r e a d i n g | a u t h | a d m i n | f r i e n d s ) ) .* / , ( req : Request , res : Response ) =>
25- res . sendFile ( join ( publicDir , 'index.html' ) ) ,
32+ server . get (
33+ / ^ (? ! \/ (?: a p i | u s e r s | b o o k s | r e a d i n g | a u t h | a d m i n | f r i e n d s ) ) .* / ,
34+ ( req : Request , res : Response ) =>
35+ res . sendFile ( join ( publicDir , 'index.html' ) ) ,
2636 ) ;
2737
2838 const port = Number ( process . env . PORT ) || 3000 ;
0 commit comments