I am new to nodejs and java script.
I am trying to read a config.json file in nodejs project using the below code snippet.whenever i run the program it's giving an error 'TypeError: Cannot set property 'getProjectSettings' of undefined'
Can some one help me to find the issue with the code?
var Env = "DEV"
function getConfigValue(configKey, subConfigKey, isblnEnvattr, callback) {
return callback(configKey, subConfigKey, isblnEnvattr);
}
function readConfigJson(configKey, subConfigKey, isblnEnvattr) {
if (Boolean(isblnEnvattr) == true) { //eg MONGODB_DEV
configKey = configKey + "_" + Env;
}
try {
return 'x';
} catch (err) {
return "key Not found";
}
}
module.export.getProjectSettings = function (configKey, subConfigKey, isblnEnvattr) {
return getConfigValue(configKey, subConfigKey, isblnEnvattr, readConfigJson)
}
getProjectSettings("Primary","secondary",false)