import 'reflect-metadata'; import { Logger } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module.js'; async function bootstrap(): Promise { const app = await NestFactory.create(AppModule, { bufferLogs: true }); const config = app.get(ConfigService); const logger = new Logger('Bootstrap'); await app.init(); const port = config.get('CACHE_REBUILDER_HEALTH_PORT', 3824); await app.listen(port, '0.0.0.0'); logger.log( `cache-rebuilder running, health on :${port}, subscribed to '${config.get('REDIS_CACHE_INVALIDATE_CHANNEL', 'platform.cache.invalidate')}'`, ); } bootstrap().catch((err: unknown) => { const logger = new Logger('Bootstrap'); logger.error('Fatal bootstrap error', err instanceof Error ? err.stack : String(err)); process.exit(1); });