16 lines
561 B
TypeScript
16 lines
561 B
TypeScript
import 'reflect-metadata';
|
|||
|
|
import { NestFactory } from '@nestjs/core';
|
||
|
|
import { ValidationPipe } from '@nestjs/common';
|
||
|
|
import { AppModule } from './app.module';
|
||
|
|
import { PrismaExceptionFilter } from './prisma/prisma-exception.filter';
|
||
|
|
|
||
|
|
async function bootstrap() {
|
||
|
|
const app = await NestFactory.create(AppModule);
|
||
|
|
app.setGlobalPrefix('api');
|
||
|
|
app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));
|
||
|
|
app.useGlobalFilters(new PrismaExceptionFilter());
|
||
|
|
app.enableCors();
|
||
|
|
await app.listen(process.env.PORT ?? 3000);
|
||
|
|
}
|
||
|
|
bootstrap();
|