Spaces:
Sleeping
Sleeping
| import { NestFactory } from '@nestjs/core'; | |
| import { AppModule } from './app.module'; | |
| import { setupSwagger } from './utils/swagger.utils'; | |
| import { ValidationPipe } from '@nestjs/common'; | |
| import { ResponseInterceptor } from './interceptors/response.interceptor'; | |
| import { HttpExceptionFilter } from './filters/http-exception.filter'; | |
| async function bootstrap() { | |
| const app = await NestFactory.create(AppModule); | |
| setupSwagger(app); | |
| app.useGlobalPipes( | |
| new ValidationPipe({ | |
| whitelist: true, | |
| forbidNonWhitelisted: true, | |
| transform: true, | |
| }), | |
| ); | |
| app.useGlobalInterceptors(new ResponseInterceptor()); | |
| app.useGlobalFilters(new HttpExceptionFilter()); | |
| await app.listen(process.env.PORT ?? 3000); | |
| } | |
| bootstrap(); | |