|
|
@ -1,7 +1,8 @@ |
|
|
import { NestFactory } from '@nestjs/core'; |
|
|
|
|
|
|
|
|
import { HttpAdapterHost, NestFactory } from '@nestjs/core'; |
|
|
import { AppModule } from './app.module'; |
|
|
import { AppModule } from './app.module'; |
|
|
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; |
|
|
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger'; |
|
|
import { ValidationPipe } from '@nestjs/common' |
|
|
import { ValidationPipe } from '@nestjs/common' |
|
|
|
|
|
import { PrismaClientExceptionFilter } from './prisma-client-exception/prisma-client-exception.filter'; |
|
|
|
|
|
|
|
|
async function bootstrap() { |
|
|
async function bootstrap() { |
|
|
const app = await NestFactory.create(AppModule); |
|
|
const app = await NestFactory.create(AppModule); |
|
|
@ -17,6 +18,9 @@ async function bootstrap() { |
|
|
const document = SwaggerModule.createDocument(app, config) |
|
|
const document = SwaggerModule.createDocument(app, config) |
|
|
SwaggerModule.setup('api', app, document) |
|
|
SwaggerModule.setup('api', app, document) |
|
|
|
|
|
|
|
|
|
|
|
const { httpAdapter } = app.get(HttpAdapterHost) |
|
|
|
|
|
app.useGlobalFilters(new PrismaClientExceptionFilter(httpAdapter)) |
|
|
|
|
|
|
|
|
await app.listen(3000); |
|
|
await app.listen(3000); |
|
|
} |
|
|
} |
|
|
bootstrap(); |
|
|
bootstrap(); |