openhim-core
Version:
The OpenHIM core application that provides logging and routing of http requests
41 lines (29 loc) • 779 B
JavaScript
var Config, nconf;
nconf = require("nconf");
/*
* Define the default constructor
*/
Config = function() {
var environment;
environment = void 0;
nconf.argv().env("_");
environment = nconf.get("NODE:ENV") || "development";
if (nconf.get("conf")) {
nconf.file('customConfigOverride', nconf.get('conf'));
}
if (environment) {
nconf.file('environmentOverride', appRoot + '/config/' + environment + '.json');
}
nconf.file('default', appRoot + '/config/default.json');
};
/*
* This function return the value that was set in the key-value store
*/
Config.prototype.get = function(key) {
return nconf.get(key);
};
/*
* This function constructs a new instanse of this class
*/
module.exports = new Config();
//# sourceMappingURL=config.js.map