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