From ed44fdbedd913c7bfdc67181102fc3293ab420ac Mon Sep 17 00:00:00 2001 From: John Varghese <126874846+John-Varghese-EH@users.noreply.github.com> Date: Tue, 3 Jun 2025 20:15:05 +0530 Subject: [PATCH] web_config.cpp --- ESP32CAM-ONVIF/web_config.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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."); }