2023-06-29 10:32:09 +02:00
|
|
|
import { ConfigService } from '@nestjs/config'
|
2023-05-26 15:43:14 -05:00
|
|
|
import { NestFactory } from '@nestjs/core'
|
2023-06-29 10:32:09 +02:00
|
|
|
|
2023-05-26 15:43:14 -05:00
|
|
|
import { AppModule } from './app.module'
|
|
|
|
|
import { CustomResponseTransformInterceptor } from './common/customResponse'
|
|
|
|
|
|
|
|
|
|
async function bootstrap() {
|
|
|
|
|
const app = await NestFactory.create(AppModule, { abortOnError: false })
|
|
|
|
|
const config = app.get(ConfigService)
|
2023-05-26 16:34:50 -05:00
|
|
|
const port = config.get('PORT', 3000)
|
2023-05-26 15:43:14 -05:00
|
|
|
app.enableShutdownHooks()
|
|
|
|
|
app.useGlobalInterceptors(new CustomResponseTransformInterceptor())
|
2023-05-26 16:34:50 -05:00
|
|
|
await app.listen(port, () => console.log(`Listening on port ${port}`))
|
2023-05-26 15:43:14 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bootstrap()
|