@@ -3,6 +3,9 @@ import { AppModule } from './app.module';
33import { ValidationPipe , Logger } from '@nestjs/common' ;
44import * as bodyParser from 'body-parser' ;
55import { DocumentBuilder , SwaggerModule } from '@nestjs/swagger' ;
6+ import * as compression from 'compression' ;
7+ import { TransformInterceptor } from './common/interceptors/transform.interceptor' ;
8+ import { LoggingInterceptor } from './common/interceptors/logging.interceptor' ;
69
710async function bootstrap ( ) {
811 const logger = new Logger ( 'Bootstrap' ) ;
@@ -30,6 +33,10 @@ async function bootstrap() {
3033 allowedHeaders : 'Content-Type, Authorization' ,
3134 credentials : true ,
3235 } ) ;
36+
37+ // Add compression
38+ app . use ( compression ( ) ) ;
39+
3340 // Swagger configuration
3441 const config = new DocumentBuilder ( )
3542 . setTitle ( 'API Documentation' )
@@ -40,6 +47,12 @@ async function bootstrap() {
4047 const document = SwaggerModule . createDocument ( app , config ) ;
4148 SwaggerModule . setup ( 'api-docs' , app , document ) ;
4249
50+ // Add global interceptors
51+ app . useGlobalInterceptors (
52+ new TransformInterceptor ( ) ,
53+ new LoggingInterceptor ( ) ,
54+ ) ;
55+
4356 const PORT = process . env . PORT || 3000 ;
4457
4558 // Start listening on the specified PORT and bind to all network interfaces
0 commit comments