import { ValidationPipe } from '@nestjs/common' ; import { NestFactory } from '@nestjs/core' ; import { useContainer } from 'class-validator' ; import { AppModule } from './app.module' ; import { PrismaService } from './prisma/prisma.service' ; async function bootstrap ( ) { const app = await NestFactory . create ( AppModule ) ; const prismaService = app . get ( PrismaService ) ; prismaService . enableShutdownHooks ( app ) ; useContainer ( app . select ( AppModule ) , { fallbackOnErrors : true } ) ; app . useGlobalPipes ( new ValidationPipe ( { whitelist : true } ) ) ; await app . listen ( 3000 ) ; } bootstrap ( ) ;