config.js
1.07 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const path = require('path');
const rootPath = path.normalize(__dirname + '/..');
const env = process.env.NODE_ENV || 'development';
const localConfig = require('./local');
// Please put all the default config in this boilerplate
const boilerplate = {
root: rootPath,
app: {
name: 'advisoreat-backend'
},
port: process.env.PORT || 3000,
database: localConfig.db,
};
boilerplate.siteUrl = `https://localhost:${boilerplate.port}`
const config = {
development: {},
test: {},
staging: {},
production: {}
};
/*** ATTENTION: Compose up your config objects! ***/
/**
* Want to override your config? Do it!
* E.g.
* Object.assign(config.yourEnvironment, boilerplate, {
* mailgun: {
* apiKey: 'env-specific-api-key'
* }
* });
*
* Will produce:
*
* {
* boilerplate.properties,
* mailgun: {
* apiKey: 'env-specific-key'
* }
* }
*/
Object.assign(config.development, boilerplate, {});
Object.assign(config.test, boilerplate, {});
Object.assign(config.staging, boilerplate, {});
Object.assign(config.production, boilerplate, {});
module.exports = config[env];