[core] enable hooks before start listening

This commit is contained in:
devlikepro committed 2024-10-08 17:46:03 +07:00
1 parent 9d857d015f
commit b6b0b1e7b3
1 file changed
+1 -1
+1 -1
View File
@@ -80,7 +80,6 @@ async function bootstrap() {
// https://github.com/iamolegga/nestjs-pino?tab=readme-ov-file#expose-stack-trace-and-error-class-in-err-property
app.useGlobalInterceptors(new LoggerErrorInterceptor());
app.enableShutdownHooks();
app.useGlobalFilters(new AllExceptionsFilter());
app.enableCors();
// Ideally, we should apply it globally.
@@ -97,6 +96,7 @@ async function bootstrap() {
swaggerConfigurator.configure(WAHA_WEBHOOKS);
AppModule.appReady(app, logger);
app.enableShutdownHooks();
const config = app.get(WhatsappConfigService);
await app.listen(config.port);
logger.info(`WhatsApp HTTP API is running on: ${await app.getUrl()}`);