cocottetech/@platform/codebase/@features/cache-rebuilder/src/main.ts
natalie 1b719e1fd7 chore(bootstrap): initial V4 commit
Clean successor to V3 (forge: lilith/atlilith). Seeded from local Mac
working tree at ~/Code/@projects/@cocottetech/. node_modules and build
artifacts excluded via .gitignore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 08:11:41 -07:00

28 lines
907 B
TypeScript

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<void> {
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<number>('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<string>('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);
});