Skip to content

Commit

Permalink
Code Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis-Riel committed Feb 3, 2023
1 parent ecd89b1 commit a80d47d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion include/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 4 additions & 10 deletions include/webserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
Expand All @@ -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)
{
Expand Down

0 comments on commit a80d47d

Please sign in to comment.