From a80d47d9cb33bbb1ca5b112679fc5c4a2f510b06 Mon Sep 17 00:00:00 2001 From: Louis Riel Date: Fri, 3 Feb 2023 08:57:53 -0500 Subject: [PATCH] Code Cleanup --- include/globals.h | 2 +- include/webserver.h | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/globals.h b/include/globals.h index e3d0deff9..916ddc9c8 100644 --- a/include/globals.h +++ b/include/globals.h @@ -1602,7 +1602,7 @@ inline bool CheckBlueBuffer(CRGB * prgb, size_t count) #endif #if ENABLE_WIFI && ENABLE_WEBSERVER - #include "spiffswebserver.h" + #include "webserver.h" #endif #if ENABLE_REMOTE diff --git a/include/webserver.h b/include/webserver.h index 008e92f59..48d098ae7 100644 --- a/include/webserver.h +++ b/include/webserver.h @@ -259,6 +259,8 @@ class CWebServer void begin() { debugI("Connecting Web Endpoints"); + extern const char html_start[] asm("_binary_data_index_html_start"); + extern const char jsx_start[] asm("_binary_data_main_jsx_start"); _server.on("/getEffectList", HTTP_GET, [this](AsyncWebServerRequest * pRequest) { this->GetEffectListText(pRequest); }); _server.on("/getStatistics", HTTP_GET, [this](AsyncWebServerRequest * pRequest) { this->GetStatistics(pRequest); }); @@ -271,16 +273,8 @@ class CWebServer _server.on("/settings", HTTP_POST, [this](AsyncWebServerRequest * pRequest) { this->SetSettings(pRequest); }); - extern const char html_start[] asm("_binary_data_index_html_start"); - extern const char jsx_start[] asm("_binary_data_main_jsx_start"); - - _server.on("/", HTTP_GET, [this](AsyncWebServerRequest * pRequest) { - pRequest->send(200, "text/html", html_start); - }); - - _server.on("/main.jsx", HTTP_GET, [this](AsyncWebServerRequest * pRequest) { - pRequest->send(200, "application/javascript", jsx_start); - }); + _server.on("/", HTTP_GET, [this](AsyncWebServerRequest * pRequest) { pRequest->send(200, "text/html", html_start);}); + _server.on("/main.jsx", HTTP_GET, [this](AsyncWebServerRequest * pRequest) { pRequest->send(200, "application/javascript", jsx_start); }); _server.onNotFound([](AsyncWebServerRequest *request) {