forked from dailydotdev/daily-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathormconfig.js
More file actions
28 lines (27 loc) · 839 Bytes
/
ormconfig.js
File metadata and controls
28 lines (27 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// const dotenv = require('dotenv');
// dotenv.config({ path: `.env.production` });
module.exports = {
type: 'postgres',
host: process.env.TYPEORM_HOST || 'localhost',
port: 5432,
username: process.env.TYPEORM_USERNAME || 'postgres',
password: process.env.TYPEORM_PASSWORD || '12345',
schema: 'public',
database:
process.env.TYPEORM_DATABASE ||
(process.env.NODE_ENV === 'test' ? 'api_test' : 'api'),
synchronize: false,
extra: {
max: 20,
idleTimeoutMillis: 120000,
},
logging: false,
entities: ['src/entity/**/*.ts', 'src/entity/**/*.js'],
migrations: ['src/migration/**/*.ts', 'src/migration/**/*.js'],
subscribers: ['src/subscriber/**/*.ts', 'src/subscriber/**/*.js'],
cli: {
entitiesDir: 'src/entity',
migrationsDir: 'src/migration',
subscribersDir: 'src/subscriber',
},
};