import { RequestMethod } from '@nestjs/common'; import { NestFactory } from '@nestjs/core'; import cookieParser from 'cookie-parser'; import { ApiModule } from './api.module'; export async function bootstrapApi(): Promise { const app = await NestFactory.create(ApiModule); app.enableShutdownHooks(); app.use(cookieParser()); app.setGlobalPrefix('api/v1', { exclude: [ { path: 'health/live', method: RequestMethod.GET }, { path: 'health/ready', method: RequestMethod.GET }, ], }); await app.listen(3000, '0.0.0.0'); } if (require.main === module) { void bootstrapApi(); }