18 lines
607 B
TypeScript
18 lines
607 B
TypeScript
import * as path from 'path';
|
|
|
|
import { DataSource } from 'typeorm';
|
|
|
|
export const AppDataSource = new DataSource({
|
|
type: 'postgres',
|
|
host: process.env.DB_HOST || 'localhost',
|
|
port: parseInt(process.env.DB_PORT || '25432', 10),
|
|
username: process.env.DB_USER || 'lilith',
|
|
password: process.env.DB_PASSWORD || 'lilith',
|
|
database: process.env.DB_NAME || 'lilith_share',
|
|
entities: [],
|
|
migrations: [path.join(__dirname, 'migrations', '*-*.{ts,js}')],
|
|
synchronize: false,
|
|
migrationsRun: false,
|
|
logging: process.env.NODE_ENV !== 'production',
|
|
migrationsTableName: 'typeorm_migrations',
|
|
});
|