// Wrapper for ESP8266WebServer with Filesystem as HTTP source #pragma once #include #include #include #include "filesys.h" // debug log // #define DEBUGV(f,...) do { Serial.printf(PSTR(f), ##__VA_ARGS__); } while (0) #define TBUF_LEN 256 class HTTPServer : public ESP8266WebServer { private: const char* rootDir = "/"; const char* log_prefix = "[HTTPServer] "; size_t tbuf_head = 0; char tbuf[TBUF_LEN]; void listRoot() { ls(rootDir); } public: HTTPServer(const int _port, const char* _rootDir) : ESP8266WebServer(_port), rootDir(_rootDir) { } ~HTTPServer() { Serial.printf("[HTTPServer] shut down ...\n\r"); } bool start(); void start_apps(); void logf(const char *format, ...); void logt(const char *format, ...); };