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["/clear"] = requestHandlers.sendClear;
|
||||
if(server.demoMode==1){
|
||||
if(server.demoMode())){
|
||||
handle["/demo"] = requestHandlers.sendDemo;
|
||||
}else{
|
||||
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",
|
||||
"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 color = 0;
|
||||
|
||||
module.exports.demoMode = 1;
|
||||
module.exports.demoMode = function () {
|
||||
return config('debug').chain().find({ param: 'demoMode' }).value()['value'];
|
||||
};
|
||||
|
||||
// utility function for ucs2 decode
|
||||
function ucs2Parse(ucs2){
|
||||
|
Loading…
Reference in New Issue
Block a user