-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
23 lines (20 loc) · 821 Bytes
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const env = process.env.NODE_ENV || 'development'
// default to dev database
const DATABASE_URL = (
process.env.DATABASE_URL ||
global.DATABASE_URL ||
'postgres://localhost/juristat_development'
);
const TEST_DATABASE_URL = (
process.env.TEST_DATABASE_URL ||
global.TEST_DATABASE_URL ||
'postgres://localhost/juristat_test');
module.exports = {
PORT: process.env.PORT || 8080,
// if we're in test environment, we use the test database url,
// otherwise DATABASE_URl, which defaults to dev
DATABASE_URL: env === 'test' ? TEST_DATABASE_URL : DATABASE_URL,
// see http://docs.sequelizejs.com/en/latest/api/sequelize/#new-sequelizedatabase-usernamenull-passwordnull-options
// SEQUELIZE_OPTIONS: {logging: env === 'test' ? false : console.log}
SEQUELIZE_OPTIONS: {logging: false}
};