Make host and port configurable (#94)

Use the previous values as the default.
pull/96/head
nblock 2020-09-16 11:20:13 +02:00 committed by GitHub
parent 09b42f24c2
commit 3eb99d2635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,8 @@
"team_name": "My Open Spacedeck", "team_name": "My Open Spacedeck",
"contact_email": "support@example.org", "contact_email": "support@example.org",
"host": "::",
"port": 9666,
"endpoint": "http://localhost:9666", "endpoint": "http://localhost:9666",
"invite_code": "top-sekrit", "invite_code": "top-sekrit",

View File

@ -114,9 +114,10 @@ module.exports = app;
db.init(); db.init();
// START WEBSERVER // START WEBSERVER
const port = 9666; const host = config.get('host');
const port = config.get('port');
const server = http.Server(app).listen(port, () => { const server = http.Server(app).listen(port, host, () => {
if ("send" in process) { if ("send" in process) {
process.send('online'); process.send('online');