import { ValidationPipe } from '@nestjs/common' ; import { NestFactory } from '@nestjs/core' ; import { useContainer } from 'class-validator' ; import { TrimStringsPipe } from './modules/common/transformer/trim-strings.pipe' ; import { AppModule } from './modules/main/app.module' ; import { setupSwagger } from './swagger' ; async function bootstrap ( ) { const app = await NestFactory . create ( AppModule ) ; setupSwagger ( app ) ; app . enableCors ( ) ; app . useGlobalPipes ( new TrimStringsPipe ( ) , new ValidationPipe ( ) ) ; useContainer ( app . select ( AppModule ) , { fallbackOnErrors : true } ) ; await app . listen ( 3000 ) ; } bootstrap ( ) ;