require ( 'dotenv' ) . config ( ) ; import { ConnectionOptions } from 'typeorm' ; import * as path from 'path' ; const config = { type : 'postgres' , host : process . env . DB_HOST , port : Number ( process . env . DB_PORT ) , username : process . env . DB_USERNAME , password : process . env . DB_PASSWORD , database : process . env . DB_NAME , entities : [ path . join ( __dirname , '../**/*.entity{.ts,.js}' ) ] , synchronize : false , migrationsRun : process . env . NODE_ENV === 'production' , logging : true , logger : process . env . NODE_ENV === 'development' ? 'file' : 'advanced-console' , migrations : [ path . join ( __dirname , '../migrations/**/*{.ts,.js}' ) ] , cli : { migrationsDir : 'src/migrations' , } , } ; export = config ;