ESP8266 Treppenlichtsteuerung mit OTA zum Firmware Upload
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

httpserver.h 692B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __HTTPSERVER_H
  2. #define __HTTPSERVER_H
  3. #include <ESP8266WebServer.h>
  4. class HTTPServer {
  5. private:
  6. int port;
  7. ESP8266WebServer* server;
  8. public:
  9. HTTPServer(int port) {
  10. server = new ESP8266WebServer;
  11. // server->on("/", handleRootGz);
  12. // server->on("/style.css", handleCssGz);
  13. // server->on("/favicon.png", handleFaviconGz);
  14. // server->onNotFound(handleNotFound);
  15. server->begin(port);
  16. }
  17. ~HTTPServer() {
  18. server->stop();
  19. delete server;
  20. }
  21. void initialize() {
  22. server->begin(port);
  23. }
  24. void handleClient() {
  25. server->handleClient();
  26. }
  27. };
  28. #endif // __HTTPSERVER_H