Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update config setup with overrides for Docker
- Loading branch information
1 parent
992eaa2
commit 1c39a51
Showing
2 changed files
with
11 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,5 @@ | ||
{ | ||
"port": 1337, | ||
"security": { | ||
"tokenLife" : 3600 | ||
}, | ||
"mongoose": { | ||
"uri": "mongodb://mongo/apiDB" | ||
}, | ||
"default": { | ||
"api": { | ||
"version" : "v1" | ||
}, | ||
"user": { | ||
"username": "myapi", | ||
"password": "abc1234" | ||
}, | ||
"client": { | ||
"name": "Android API v1", | ||
"clientId": "android", | ||
"clientSecret": "SomeRandomCharsAndNumbers" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
var nconf = require('nconf'); | ||
|
||
var config = (process.env.ENV_IN === 'docker') ? | ||
'/docker.config.json' : | ||
'/config.json'; | ||
nconf.argv().env(); | ||
|
||
nconf.argv() | ||
.env() | ||
.file({ | ||
file: process.cwd() + config | ||
}); | ||
if (process.env.ENV_IN === 'docker') { | ||
nconf.file('docker', { | ||
file: process.cwd() + '/docker.config.json' | ||
}); | ||
} | ||
|
||
module.exports = nconf; | ||
nconf.file('defaults', { | ||
file: process.cwd() + '/config.json' | ||
}); | ||
|
||
module.exports = nconf; |