Load the settings even when not starting in node path
This commit is contained in:
parent
d73f053b5a
commit
33ffda19b1
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
|
||||
var fs = require("fs");
|
||||
var path = require('path');
|
||||
|
||||
/**
|
||||
* The IP ep-lite should listen to
|
||||
|
@ -74,7 +75,8 @@ exports.loglevel = "INFO";
|
|||
exports.httpAuth = null;
|
||||
|
||||
//read the settings sync
|
||||
var settingsStr = fs.readFileSync("../settings.json").toString();
|
||||
var settingsPath = path.normalize(__dirname + "/../../");
|
||||
var settingsStr = fs.readFileSync(settingsPath + "settings.json").toString();
|
||||
|
||||
//remove all comments
|
||||
settingsStr = settingsStr.replace(/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+/gm,"").replace(/#.*/g,"").replace(/\/\/.*/g,"");
|
||||
|
|
Loading…
Reference in New Issue