-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathormconfig.js
More file actions
34 lines (31 loc) · 767 Bytes
/
ormconfig.js
File metadata and controls
34 lines (31 loc) · 767 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
29
30
31
32
33
34
const env = require('getenv');
let config;
if (process.env.NODE_ENV === 'production') {
config = {
type: 'postgres',
url: env('DATABASE_URL'),
synchronize: false,
migrationsRun: true,
logging: false,
entities: ['build/entities/**/*.js'],
migrations: ['build/migrations/**/*.js'],
};
} else {
config = {
type: 'postgres',
host: 'localhost',
username: 'postgres',
password: 'postgres',
database: 'typescript_handlebars_realworld_dev',
synchronize: false,
migrationsRun: true,
logging: false,
entities: ['src/entities/**/*.ts'],
migrations: ['src/migrations/**/*.ts'],
cli: {
entitiesDir: 'src/entities',
migrationsDir: 'src/migrations',
},
};
}
module.exports = config;