2021-11-16 21:14:46 -05:00
|
|
|
import { TypeOrmModuleOptions } from '@nestjs/typeorm';
|
|
|
|
import '../env';
|
|
|
|
|
|
|
|
export const config: TypeOrmModuleOptions =
|
|
|
|
process.env.NODE_ENV === 'development'
|
|
|
|
? {
|
|
|
|
type: 'postgres',
|
|
|
|
host: 'localhost',
|
|
|
|
port: 5432,
|
|
|
|
database: process.env.DATABASE_URL,
|
|
|
|
autoLoadEntities: true,
|
|
|
|
}
|
|
|
|
: {
|
2021-12-04 22:57:25 -05:00
|
|
|
type: 'postgres',
|
2021-11-16 21:14:46 -05:00
|
|
|
url: process.env.DATABASE_URL,
|
2021-12-04 23:14:01 -05:00
|
|
|
autoLoadEntities: true,
|
2021-12-04 23:03:04 -05:00
|
|
|
ssl: { rejectUnauthorized: false },
|
2021-11-16 21:14:46 -05:00
|
|
|
};
|