import 'reflect-metadata'; import { NestFactory } from '@nestjs/core'; import { ValidationPipe } from '@nestjs/common'; import { AppModule } from './app.module'; import { prepareDatabase } from './prisma/bootstrap'; import { PrismaExceptionFilter } from './prisma/prisma-exception.filter'; async function bootstrap() { await prepareDatabase(); const app = await NestFactory.create(AppModule); app.setGlobalPrefix('api'); app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true })); app.useGlobalFilters(new PrismaExceptionFilter()); app.enableCors(); // Bind all interfaces explicitly so the container is reachable from nginx. await app.listen(process.env.PORT ?? 3000, '0.0.0.0'); } bootstrap();