From 991e9426c037bc98a67a39348f27499795695304 Mon Sep 17 00:00:00 2001
From: asanrom
Remove User-Data on connection reset.
'; + html += ''; html += ''; html += ''; diff --git a/src/server/server.js b/src/server/server.js index 4b1bf76..76f8121 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -313,13 +313,17 @@ class Server { } else if (!context.url.path || context.url.path === '/') { /* Main page */ context.setMenu(this.getMenu(context)); - FileSystem.readFile(Path.resolve(__dirname, 'main.html'), (error, data) => { - if (error) { - context.endWithError(500, 'Internal Server Error', 'Error: ' + error.code + " (" + error.message + ")"); - } else { - context.endWithWebPage(data.toString(), {title: "Showdown ChatBot - Control Panel"}); - } - }); + if (App.config.mainhtml) { + context.endWithWebPage(App.config.mainhtml, {title: "Showdown ChatBot - Control Panel"}); + } else { + FileSystem.readFile(Path.resolve(__dirname, 'main.html'), (error, data) => { + if (error) { + context.endWithError(500, 'Internal Server Error', 'Error: ' + error.code + " (" + error.message + ")"); + } else { + context.endWithWebPage(data.toString(), {title: "Showdown ChatBot - Control Panel"}); + } + }); + } } else { /* Handlers */ let urlParts = context.url.path.split('/');