SPIFFS-backed PersistentStore for ESP32 (#13566)

This commit is contained in:
Kajetan Rzepecki
2019-04-04 03:28:26 +02:00
committed by Scott Lahteine
parent af92ee9dd6
commit b21ca53dfc
5 changed files with 171 additions and 9 deletions

View File

@@ -23,9 +23,6 @@
#if ENABLED(WEBSUPPORT)
#include "../../core/serial.h"
#include "FS.h"
#include "SPIFFS.h"
#include "wifi.h"
@@ -37,12 +34,8 @@ void onNotFound(AsyncWebServerRequest *request){
void web_init() {
server.addHandler(&events); // attach AsyncEventSource
if (SPIFFS.begin()) {
server.serveStatic("/", SPIFFS, "/www").setDefaultFile("index.html");
server.onNotFound(onNotFound);
}
else
SERIAL_ECHO_MSG("SPIFFS Mount Failed");
server.serveStatic("/", SPIFFS, "/www").setDefaultFile("index.html");
server.onNotFound(onNotFound);
}
#endif // WEBSUPPORT