import { INestApplication, ValidationPipe } from '@nestjs/common'; import { DomainErrorFilter } from '@task-stream/api/shared/presenters'; import { setupOpenApi } from './openapi'; /** Everything main.ts sets on the app, shared with the e2e tests. */ export function configureApp(app: INestApplication): void { app.setGlobalPrefix('api'); app.enableCors(); app.enableShutdownHooks(); app.useGlobalPipes(new ValidationPipe({ transform: true, whitelist: true })); app.useGlobalFilters(new DomainErrorFilter()); setupOpenApi(app); }