@@ -17,23 +17,28 @@ import { LoggerErrorInterceptor } from "nestjs-pino";
17
17
import { AppModule } from "./modules/app.module" ;
18
18
import { SocketIOAdapter } from "./socket-io.adapter" ;
19
19
20
- declare const module : { hot : { accept : ( ) => void , dispose : ( argument : ( ) => Promise < void > ) => void } } ;
20
+ declare const module : {
21
+ hot : { accept : ( ) => void ; dispose : ( argument : ( ) => Promise < void > ) => void } ;
22
+ } ;
21
23
22
24
const logger = new Logger ( "Bootstrap" ) ;
23
25
24
26
async function bootstrap ( ) {
25
- const app = await NestFactory . create < NestExpressApplication > ( AppModule , new ExpressAdapter ( ) , {
26
- snapshot : true ,
27
- } ) ;
27
+ const app = await NestFactory . create < NestExpressApplication > (
28
+ AppModule ,
29
+ new ExpressAdapter ( ) ,
30
+ {
31
+ snapshot : true ,
32
+ } ,
33
+ ) ;
28
34
29
35
const configService = app . get ( ConfigService < Configs , true > ) ;
30
36
31
37
// =========================================================
32
38
// configure swagger
33
39
// =========================================================
34
40
35
- if ( ! HelperService . isProd ( ) )
36
- AppUtils . setupSwagger ( app , configService ) ;
41
+ if ( ! HelperService . isProd ( ) ) AppUtils . setupSwagger ( app , configService ) ;
37
42
38
43
// ======================================================
39
44
// security and middlewares
@@ -67,7 +72,9 @@ async function bootstrap() {
67
72
68
73
app . useGlobalPipes ( new ValidationPipe ( AppUtils . validationPipeOptions ( ) ) ) ;
69
74
70
- app . useGlobalFilters ( new I18nValidationExceptionFilter ( { detailedErrors : false } ) ) ;
75
+ app . useGlobalFilters (
76
+ new I18nValidationExceptionFilter ( { detailedErrors : false } ) ,
77
+ ) ;
71
78
72
79
app . useGlobalInterceptors ( new LoggerErrorInterceptor ( ) ) ;
73
80
@@ -95,7 +102,8 @@ async function bootstrap() {
95
102
module . hot . dispose ( ( ) => app . close ( ) ) ;
96
103
}
97
104
98
- const port = process . env . PORT ?? configService . get ( "app.port" , { infer : true } ) ! ;
105
+ const port =
106
+ process . env . PORT ?? configService . get ( "app.port" , { infer : true } ) ! ;
99
107
100
108
await app . listen ( port ) ;
101
109
@@ -120,7 +128,6 @@ async function bootstrap() {
120
128
121
129
try {
122
130
( async ( ) => await bootstrap ( ) ) ( ) ;
123
- }
124
- catch ( error ) {
131
+ } catch ( error ) {
125
132
logger . error ( error ) ;
126
133
}
0 commit comments