2023-07-24 20:27:36 +00:00
|
|
|
require('dotenv').config();
|
|
|
|
import 'reflect-metadata';
|
|
|
|
import { DataSource } from 'typeorm';
|
|
|
|
import config from 'config';
|
|
|
|
|
|
|
|
const postgresConfig = config.get<{
|
|
|
|
host: string;
|
|
|
|
port: number;
|
|
|
|
username: string;
|
|
|
|
password: string;
|
|
|
|
database: string;
|
|
|
|
}>('postgresConfig');
|
|
|
|
|
|
|
|
export const AppDataSource = new DataSource({
|
|
|
|
...postgresConfig,
|
|
|
|
type: 'postgres',
|
2023-07-25 01:40:22 +00:00
|
|
|
synchronize: true,
|
2023-07-24 20:27:36 +00:00
|
|
|
logging: false,
|
|
|
|
entities: ['server/entities/**/*.entity{.ts,.js}'],
|
|
|
|
migrations: ['server/migrations/**/*{.ts,.js}'],
|
|
|
|
// subscribers: ['server/subscribers/**/*{.ts,.js}'],
|
|
|
|
});
|