import './boilerplate.polyfill' ; import { Module } from '@nestjs/common' ; import { ConfigModule } from '@nestjs/config' ; import { TypeOrmModule } from '@nestjs/typeorm' ; import { I18nJsonParser , I18nModule } from 'nestjs-i18n' ; import path from 'path' ; import { AuthModule } from './modules/auth/auth.module' ; import { HealthCheckerModule } from './modules/health-checker/health-checker.module' ; import { PostModule } from './modules/post/post.module' ; import { UserModule } from './modules/user/user.module' ; import { ApiConfigService } from './shared/services/api-config.service' ; import { SharedModule } from './shared/shared.module' ; @ Module ( { imports : [ AuthModule , UserModule , PostModule , ConfigModule . forRoot ( { isGlobal : true , envFilePath : process . env . NODE_ENV === 'test' ? '.test.env' : '.env' , } ) , TypeOrmModule . forRootAsync ( { imports : [ SharedModule ] , useFactory : ( configService ) => configService . postgresConfig , inject : [ ApiConfigService ] , } ) , I18nModule . forRootAsync ( { useFactory : ( configService ) => ( { fallbackLanguage : configService . fallbackLanguage , parserOptions : { path : path . join ( __dirname , '/i18n/' ) , watch : configService . isDevelopment , } , } ) , imports : [ SharedModule ] , parser : I18nJsonParser , inject : [ ApiConfigService ] , } ) , HealthCheckerModule , ] , } ) export class AppModule { }