diff --git a/ESP32CAM-ONVIF/web_config.cpp b/ESP32CAM-ONVIF/web_config.cpp index eee277c..1d94a0b 100644 --- a/ESP32CAM-ONVIF/web_config.cpp +++ b/ESP32CAM-ONVIF/web_config.cpp @@ -2,6 +2,8 @@ #include #include #include "rtsp_server.h" +#include +#include // or LittleFS.h WebServer webConfigServer(80); @@ -17,7 +19,12 @@ void handle_root() { } void web_config_start() { - webConfigServer.on("/", HTTP_GET, handle_root); + if (!SPIFFS.begin(true)) { + Serial.println("SPIFFS/LittleFS Mount Failed"); + return; + } + webConfigServer.serveStatic("/", SPIFFS, "/index.html").setDefaultFile("index.html"); + // Optionally serve other assets (css, js) if you split them webConfigServer.begin(); Serial.println("[INFO] Web config server started."); }