-
Notifications
You must be signed in to change notification settings - Fork 2
/
config.js
36 lines (32 loc) · 1 KB
/
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
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
const ENV_DEFAULT = 'development';
const ENV_PRODUCTION = 'production';
const envName = process.env.NODE_ENV || ENV_DEFAULT;
const envJson = require(`./config/${envName}.json`);
const moment = require('moment-timezone');
moment.tz.setDefault(envJson.timezone);
/**
* @type {Object}
* @property {number} timezone
* @property {String} db.dialect
* @property {String} db.host
* @property {number} db.port
* @property {String} db.name
* @property {String} db.username
* @property {String} db.password
* @property {boolean} db.forceSync
* @property {boolean} db.logging
* @property {String} db.socketPath
* @property {boolean} ssl.enabled
* @property {String} ssl.key - SSL private key
* @property {String} ssl.cert - SSL certificate
* @property {String} ssl.ca - SSL certificate authority
* @property {String} env
* @property {Function} isProduction
*/
module.exports = Object.assign({}, envJson, {
env: envName,
isProduction() {
return this.env === ENV_PRODUCTION;
},
});