Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added "enableAdmin=false". Which allows to enable/disable /admin/ page
"enableLogs" is disabled by default. "autoRebootServerOnFailure" is disabled by default. getJsonFile now handles error if JSON file is missing. "dirPath" is set to EMPTY string to force current-directory as default option. Behind the scene "process.cwd()" is used for empty "dirPath".
- Loading branch information
Showing
8 changed files
with
73 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
{ | ||
"socketURL": "/", | ||
"dirPath": "./", | ||
"dirPath": "", | ||
"homePage": "/demos/index.html", | ||
"socketMessageEvent": "RTCMultiConnection-Message", | ||
"socketCustomEvent": "RTCMultiConnection-Custom-Message", | ||
"port": "9001", | ||
"enableLogs": "true", | ||
"autoRebootServerOnFailure": "true", | ||
"enableLogs": "false", | ||
"autoRebootServerOnFailure": "false", | ||
"isUseHTTPs": "false", | ||
"sslKey": "./fake-keys/privatekey.pem", | ||
"sslCert": "./fake-keys/certificate.pem", | ||
"sslCabundle": "", | ||
"enableAdmin": "false", | ||
"adminUserName": "username", | ||
"adminPassword": "password" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
function getJsonFile(path) { | ||
var fs = require('fs'); | ||
var json = fs.readFileSync(path); | ||
return JSON.parse(json); | ||
var output = {}; | ||
try { | ||
var json = fs.readFileSync(path); | ||
output = JSON.parse(json); | ||
} | ||
catch(e) { | ||
output = {}; | ||
|
||
// console.log(e.message, e.stack); | ||
} | ||
return output; | ||
} | ||
|
||
module.exports = exports = getJsonFile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters