From 296c11d1266bc807de4f156684e3c0274f00b8cd Mon Sep 17 00:00:00 2001 From: Igor Katsuba Date: Mon, 15 Jan 2024 14:41:25 +0200 Subject: [PATCH] fix: enable shutdown hooks Close #316 --- apps/api/src/main.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 434a42f..5b68438 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -24,6 +24,11 @@ async function bootstrap() { const configService = app.get>(ConfigService); const port = configService.get('PORT', 3000); + + if (configService.get('ENV') !== 'development') { + app.enableShutdownHooks(); + } + await app.listen(port); logger.log( `🚀 Application is running on: http://localhost:${port}/${globalPrefix}`