mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 22:54:37 +02:00
Handle (default) case of web server being disabled in file areas/web link generation
This commit is contained in:
parent
701f3c9728
commit
6406d32165
4 changed files with 40 additions and 10 deletions
|
@ -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) );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue