Merge pull request #507 from Pax1601/495-make-ui-port-configurable-from-olympusjson

Added port selection to config
This commit is contained in:
Pax1601 2023-11-08 09:59:50 +01:00 committed by GitHub
commit 01b3336709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -1,5 +1,9 @@
#!/usr/bin/env node
var fs = require('fs');
let rawdata = fs.readFileSync('../olympus.json');
let config = JSON.parse(rawdata);
/**
* Module dependencies.
*/
@ -12,8 +16,14 @@ var http = require('http');
* Get port from environment and store in Express.
*/
var port = normalizePort(process.env.PORT || '3000');
var configPort = null;
if (config["client"] != undefined && config["client"]["port"] != undefined) {
configPort = config["client"]["port"];
}
var port = normalizePort(configPort || '3000');
app.set('port', port);
console.log("Express server listening on port: " + port)
/**
* Create HTTP server.

View File

@ -9,6 +9,7 @@
"redCommanderPassword": "redpassword"
},
"client": {
"port": 3000,
"elevationProvider": {
"provider": "https://srtm.fasma.org/{lat}{lng}.SRTMGL3S.hgt.zip",
"username": null,