/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
apps/ws/src/bootstrap.ts
51 строка
1 KB
Adam Chmara
chore(root): apply biome formatter & linter fixes NV-6436 (#8838)
31 июл 2025, 14:59
Не верифицирован
31 июл 2025, 14:59
855fb8f
Код
Авторство
О чём код?
import './instrument'; import { NestFactory } from '@nestjs/core'; import { BullMqService, getErrorInterceptor, Logger } from '@novu/application-generic'; import helmet from 'helmet'; import { AppModule } from './app.module'; import { CONTEXT_PATH, validateEnv } from './config'; import { InMemoryIoAdapter } from './shared/framework/in-memory-io.adapter'; import { prepareAppInfra, startAppInfra } from './socket/services'; // Validate the ENV variables after launching SENTRY, so missing variables will report to sentry validateEnv(); export async function bootstrap() { BullMqService.haveProInstalled(); const app = await NestFactory.create(AppModule, { bufferLogs: true }); const inMemoryAdapter = new InMemoryIoAdapter(app); await inMemoryAdapter.connectToInMemoryCluster(); app.useLogger(app.get(Logger)); app.flushLogs(); await prepareAppInfra(app); app.useGlobalInterceptors(getErrorInterceptor()); app.setGlobalPrefix(CONTEXT_PATH); app.use(helmet()); app.enableCors({ origin: '*', preflightContinue: false, allowedHeaders: ['Content-Type', 'Authorization'], methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'OPTIONS'], }); app.useWebSocketAdapter(inMemoryAdapter); app.enableShutdownHooks(); await app.init(); try { await startAppInfra(app); } catch (e) { process.exit(1); } await app.listen(process.env.PORT as string); }