'use strict' ; require ( 'dotenv' ) . config ( ) ; import { NestFactory } from '@nestjs/core' ; import * as express from 'express' ; import * as bodyParser from 'body-parser' ; import { DispatchError } from './modules/common/filters/DispatchError' ; import { ApplicationModule } from './modules/app.module' ; const instance = express ( ) ; instance . use ( bodyParser . json ( ) ) ; instance . use ( bodyParser . urlencoded ( { extended : false } ) ) ; async function bootstrap ( ) { const app = await NestFactory . create ( ApplicationModule , instance ) ; app . useGlobalFilters ( new DispatchError ( ) ) ; await app . listen ( 3000 ) ; } bootstrap ( ) . then ( ( ) => console . log ( 'Application is listening on port 3000.' ) ) ;