0.1.1 • Published 8 years ago
relayr-config-js v0.1.1
Config Loader for NodeJS Services
usage:
let options = {
consulHost: '<DEFAULT_CONSUL_HOST>',
environment: '<DEFAULT_ENVIRONMENT>',
application: '<APPLICATION_NAME>',
consulToken: '<DEFAULT_CONSUL_TOKEN>'
}
const configLoader = require('config-js')(options)
const config = yield configLoader.loadConfig();
or:
let options = {
consulHost: '<DEFAULT_CONSUL_HOST>',
environment: '<DEFAULT_ENVIRONMENT>',
application: '<APPLICATION_NAME>',
consulToken: '<DEFAULT_CONSUL_TOKEN>'
}
const configLoader = require('config-js')(options);
const configTemplate = … // get the Config Template from somewhere.
const config = yield configLoader.resolveConfig(configTemplate);