1
0

Move demoMode to config.json

This commit is contained in:
eorg_oz 2017-03-06 18:04:01 +01:00
parent fb084d299a
commit 1d4301ac8d
3 changed files with 10 additions and 2 deletions

2
app.js Normal file → Executable file
View File

@ -14,7 +14,7 @@ handle["/js/jquery-ui.js"] = requestHandlers.sendJqueryUI;
handle["/css/bootstrap.min.css"] = requestHandlers.sendBootstrap; handle["/css/bootstrap.min.css"] = requestHandlers.sendBootstrap;
handle["/clear"] = requestHandlers.sendClear; handle["/clear"] = requestHandlers.sendClear;
if(server.demoMode==1){ if(server.demoMode())){
handle["/demo"] = requestHandlers.sendDemo; handle["/demo"] = requestHandlers.sendDemo;
}else{ }else{
console.log("ERROR: Demo mode not active"); console.log("ERROR: Demo mode not active");

6
sample.config.json Normal file → Executable file
View File

@ -16,5 +16,11 @@
"param": "mynumber", "param": "mynumber",
"value": "+43************" "value": "+43************"
} }
],
"debug": [
{
"param": "demoMode",
"value": true
}
] ]
} }

4
server.js Normal file → Executable file
View File

@ -19,7 +19,9 @@ var numberRecieved = "";
var timeRecieved = ""; var timeRecieved = "";
var color = 0; var color = 0;
module.exports.demoMode = 1; module.exports.demoMode = function () {
return config('debug').chain().find({ param: 'demoMode' }).value()['value'];
};
// utility function for ucs2 decode // utility function for ucs2 decode
function ucs2Parse(ucs2){ function ucs2Parse(ucs2){