import { Logger } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import { FastifyAdapter, NestFastifyApplication, } from '@nestjs/platform-fastify'; import { AppModule } from './app.module'; import { configureApp } from './configure-app'; import { setupSwagger } from './docs/swagger'; async function bootstrap(): Promise { const app = await NestFactory.create( AppModule, new FastifyAdapter(), { bufferLogs: true, }, ); configureApp(app); setupSwagger(app); app.enableShutdownHooks(); const host = process.env.APP_HOST ?? '0.0.0.0'; const port = Number(process.env.APP_PORT ?? 8080); await app.listen(port, host); Logger.log(`Listening on http://${host}:${port}`, 'Bootstrap'); } bootstrap().catch((error) => { Logger.error('Fatal error during bootstrap', error); process.exit(1); });