2019-07-09 09:22:36 +00:00
|
|
|
import { ConnectionOptions } from 'typeorm';
|
|
|
|
import { resolve } from 'path';
|
|
|
|
import { config } from 'dotenv';
|
2019-07-16 06:17:19 +00:00
|
|
|
|
2019-07-09 09:22:36 +00:00
|
|
|
config({ path: resolve('.env') });
|
|
|
|
|
|
|
|
export const dbConfig: ConnectionOptions = {
|
|
|
|
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_DATABASE,
|
|
|
|
synchronize: false,
|
|
|
|
logging: false,
|
|
|
|
entities: [__dirname + '/entities/*{.ts,.js}'],
|
|
|
|
};
|