Handle (default) case of web server being disabled in file areas/web link generation
This commit is contained in:
@@ -53,12 +53,12 @@ exports.getModule = class WebServerModule extends ServerModule {
|
||||
constructor() {
|
||||
super();
|
||||
|
||||
this.enableHttp = Config.contentServers.web.http.enabled || true;
|
||||
this.enableHttp = Config.contentServers.web.http.enabled || false;
|
||||
this.enableHttps = Config.contentServers.web.https.enabled || false;
|
||||
|
||||
this.routes = {};
|
||||
|
||||
if(Config.contentServers.web.staticRoot) {
|
||||
if(this.isEnabled() && Config.contentServers.web.staticRoot) {
|
||||
this.addRoute({
|
||||
method : 'GET',
|
||||
path : '/static/.*$',
|
||||
@@ -67,6 +67,10 @@ exports.getModule = class WebServerModule extends ServerModule {
|
||||
}
|
||||
}
|
||||
|
||||
isEnabled() {
|
||||
return this.enableHttp || this.enableHttps;
|
||||
}
|
||||
|
||||
createServer() {
|
||||
if(this.enableHttp) {
|
||||
this.httpServer = http.createServer( (req, resp) => this.routeRequest(req, resp) );
|
||||
|
||||
Reference in New Issue
Block a user