import { ClassSerializerInterceptor } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { NestFactory, Reflector } from '@nestjs/core'; import { AppModule } from './app.module'; import { CommonConfig } from './config/common-config.interface'; import { AwsExceptionFilter } from './_context/exception.filter'; const bodyParser = require('body-parser'); (async () => { const app = await NestFactory.create(AppModule); // app.useGlobalInterceptors(new ClassSerializerInterceptor(app.get(Reflector))); app.useGlobalFilters(new AwsExceptionFilter()); app.use(bodyParser.json({ type: 'application/x-amz-json-1.1'})); const configService: ConfigService = app.get(ConfigService); await app.listen(configService.get('PORT'), () => console.log(`Listening on port ${configService.get('PORT')}`)); })();