esp_http_server to serve files from spiffs
Posted: Sun Dec 02, 2018 11:22 pm
Im looking to see if it is possible to use the new esp_http_server.
The usecase is to serve files from spiffs, so you can start creating a website.
Current architecture of this server requires me to register a handler for every URI.
I might be overlooking something here, Is there any way to do this usecase of serving files?
A solution could be to allow matching uri-handlers to have a wildcard, and not only a full string match. E.G:
I want to have an uri handler for /spiffs/* so it would respond also to /spiffs/whateverfilename
The handler would then open the file, look at the extention for content-type and serve it.
The usecase is to serve files from spiffs, so you can start creating a website.
Current architecture of this server requires me to register a handler for every URI.
I might be overlooking something here, Is there any way to do this usecase of serving files?
A solution could be to allow matching uri-handlers to have a wildcard, and not only a full string match. E.G:
I want to have an uri handler for /spiffs/* so it would respond also to /spiffs/whateverfilename
The handler would then open the file, look at the extention for content-type and serve it.