@@ -196,6 +196,11 @@ namespace wifi {
196196 setHidden (settings::getAccessPointSettings ().hidden );
197197 setCaptivePortal (settings::getWebSettings ().captive_portal );
198198
199+ // copy web files to SPIFFS
200+ if (settings::getWebSettings ().use_spiffs ) {
201+ copyWebFiles (false );
202+ }
203+
199204 // Set mode
200205 mode = wifi_mode_t ::off;
201206 WiFi.mode (WIFI_OFF);
@@ -404,6 +409,11 @@ namespace wifi {
404409 // ================================================================
405410 #endif /* ifdef USE_PROGMEM_WEB_FILES */
406411
412+ // aggressively caching static assets
413+ if (settings::getWebSettings ().use_spiffs ) {
414+ server.serveStatic (" /" , LittleFS, String (ap_settings.path ).c_str (), " max-age=86400" );
415+ }
416+
407417 server.on (" /run" , HTTP_GET, []() {
408418 server.send (200 , str (W_TXT), str (W_OK).c_str ());
409419 String input = server.arg (" cmd" );
@@ -414,9 +424,6 @@ namespace wifi {
414424 server.send (200 , str (W_JSON), attack.getStatusJSON ());
415425 });
416426
417- // aggressively caching static assets
418- server.serveStatic (" /js" , LittleFS, String (String (ap_settings.path ) + " /js" ).c_str (), " max-age=86400" );
419-
420427 // called when the url is not defined here
421428 // use it to load content from SPIFFS
422429 server.onNotFound ([]() {
0 commit comments