1
0

Move debug to config

This commit is contained in:
eorg_oz 2017-03-08 16:20:51 +01:00
parent d1a99e9f65
commit 462b2a0f9e
3 changed files with 10 additions and 1 deletions

2
app.js
View File

@ -2,7 +2,7 @@ var server = require("./server");
var router = require("./route"); var router = require("./route");
var requestHandlers = require("./requestHandlers"); var requestHandlers = require("./requestHandlers");
var debug = false; // todo move this to configfile var debug = server.debugMode();
var handle = {} var handle = {}
handle["/"] = requestHandlers.sendInterface; handle["/"] = requestHandlers.sendInterface;

View File

@ -21,6 +21,10 @@
{ {
"param": "demoMode", "param": "demoMode",
"value": true "value": true
},
{
"param": "debugMode",
"value": false
} }
] ]
} }

View File

@ -23,6 +23,11 @@ module.exports.demoMode = function () {
return config('debug').chain().find({ param: 'demoMode' }).value()['value']; return config('debug').chain().find({ param: 'demoMode' }).value()['value'];
}; };
module.exports.debugMode = function () {
return config('debug').chain().find({ param: 'debugMode' }).value()['value'];
};
// utility function for ucs2 decode // utility function for ucs2 decode
function ucs2Parse(ucs2){ function ucs2Parse(ucs2){
codeArray = ucs2.match(/.{1,4}/g); codeArray = ucs2.match(/.{1,4}/g);