12345678910111213141516171819202122232425262728293031323334353637 |
- #ifndef __HTTPSERVER_H
- #define __HTTPSERVER_H
-
- #include <ESP8266WebServer.h>
-
- class HTTPServer {
- private:
- int port;
- ESP8266WebServer* server;
-
- public:
- HTTPServer(int port) {
- server = new ESP8266WebServer;
-
- // server->on("/", handleRootGz);
- // server->on("/style.css", handleCssGz);
- // server->on("/favicon.png", handleFaviconGz);
- // server->onNotFound(handleNotFound);
-
- server->begin(port);
- }
- ~HTTPServer() {
- server->stop();
- delete server;
- }
-
- void initialize() {
- server->begin(port);
- }
-
- void handleClient() {
- server->handleClient();
- }
- };
-
-
- #endif // __HTTPSERVER_H
|