import { HttpAdapterHost, NestFactory } from '@nestjs/core' import { PrismaClientExceptionFilter, PrismaService } from 'nestjs-prisma' import { AppModule } from './app.module' async function bootstrap() { const app = await NestFactory.create(AppModule) // enable shutdown hook const prismaService = app.get(PrismaService) await prismaService.enableShutdownHooks(app) // Prisma Client Exception Filter for unhandled exceptions const { httpAdapter } = app.get(HttpAdapterHost) app.useGlobalFilters(new PrismaClientExceptionFilter(httpAdapter)) await app.listen(3000) } bootstrap()