forked from lbsadmin/nodeMessageBoard
Move demoMode to config.json
This commit is contained in:
parent
fb084d299a
commit
1d4301ac8d
2
app.js
Normal file → Executable file
2
app.js
Normal file → Executable 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
6
sample.config.json
Normal file → Executable 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
4
server.js
Normal file → Executable 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){
|
||||||
|
Loading…
Reference in New Issue
Block a user