You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
502 B
22 lines
502 B
let { logger } = require('./logging');
|
|
|
|
var configPath = null;
|
|
var config = null;
|
|
|
|
function sanitizeConfig(config) {
|
|
let clonedConfig = { ...config };
|
|
clonedConfig.accessToken = "******"
|
|
return clonedConfig;
|
|
}
|
|
|
|
function getConfig(configFile) {
|
|
if (config === null) {
|
|
configPath = configFile;
|
|
config = require(configFile);
|
|
logger.info("Loaded config:");
|
|
logger.debug("%o", sanitizeConfig(config));
|
|
}
|
|
return config;
|
|
}
|
|
|
|
exports.getConfig = getConfig
|