#pragma once #include #include #include #include #include class ESPMegaWebServer { public: ESPMegaWebServer(uint16_t port, ESPMegaIoT *iot); ~ESPMegaWebServer(); void begin(); void loop(); private: // Web Server AsyncWebServer *server; uint16_t port; // ESPMegaIoT ESPMegaIoT *iot; // Endpoints Handlers void dashboardHandler(AsyncWebServerRequest *request); String dashboardProcessor(const String& var); void configHandler(AsyncWebServerRequest *request); String configProcessor(const String& var); void saveConfigHandler(AsyncWebServerRequest *request); void otaHandler(AsyncWebServerRequest *request); void restAPIHandler(AsyncWebServerRequest *request); };