Add LittleFS support to ESP8266WebServer.serveStatic() by JasperHorn · Pull Request #6987 · esp8266/Arduino (original) (raw)
The problem was that the library was assuming that FS::exists()
would return false for directories, which is true for SPIFFS, but not for LittleFS. I changed the implementation to be compatible with both.
I don't like using fs.open()
, but I couldn't find any better way to check if something is a directory or a file. If there is such a thing, please point me in the right direction and I will be happy to use that instead.