ESPMegaPRO-v3-SDK/ESPMegaPRO-firmware/lib/ESPMegaPRO/ESPMegaWebServer.hpp

26 lines
745 B
C++
Raw Normal View History

2023-12-29 18:23:33 +00:00
#pragma once
2023-12-31 08:53:39 +00:00
#include <FS.h>
2023-12-29 18:23:33 +00:00
#include <ESPAsyncWebServer.h>
#include <ESPMegaIoT.hpp>
#include <Update.h>
class ESPMegaWebServer
{
public:
ESPMegaWebServer(uint16_t port);
~ESPMegaWebServer();
void begin(ESPMegaIoT *iot);
void loop();
private:
// Web Server
AsyncWebServer server;
uint16_t port;
// ESPMegaIoT
ESPMegaIoT *iot;
// Endpoints Handlers
void dashboardHandler(AsyncWebServerRequest *request);
void configHandler(AsyncWebServerRequest *request);
void saveConfigHandler(AsyncWebServerRequest *request);
void otaHandler(AsyncWebServerRequest *request);
2023-12-31 08:53:39 +00:00
void restAPIHandler(AsyncWebServerRequest *request);
2023-12-29 18:23:33 +00:00
};