webserver header

This commit is contained in:
Siwat Sirichai 2023-12-30 01:23:33 +07:00
parent 5f0dedc7eb
commit f17b220a38
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,24 @@
#pragma once
#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);
};

View File

@ -26,5 +26,6 @@ lib_deps = adafruit/Adafruit PWM Servo Driver Library@^2.4.1
knolleary/pubsubclient@^2.8.0 knolleary/pubsubclient@^2.8.0
seithan/Easy Nextion Library@^1.0.6 seithan/Easy Nextion Library@^1.0.6
z3t0/IRremote@^4.2.0 z3t0/IRremote@^4.2.0
esphome/ESPAsyncWebServer-esphome@^3.1.0
monitor_speed = 115200 monitor_speed = 115200