You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Thomas,
thanks for your great work.
I'm looking for a way to store a css file on the ESP in LittleFS instead of referencing a css file on an external link.
Any hints if this is currently possible?
Thanks
Chris
The text was updated successfully, but these errors were encountered:
Sorry for the long delay. This is definitely possible, but somewhat out of scope for EmbAJAX itself. Note that EmbAJAX itself utilizes the whatever webserver implementation is available for your board. For most (ESPAsyncWebServer being slightly different), the procedure will be something like:
// at global scope
void serveCss() {
File file = fileSystem->open("my.css", "r");
server.streamFile(file, "text/css");
file.close();
}
// in setup():
server.on("/my.css", serveCss);
Now, the only thing to do in EmbAJAX is to add a corresponding link to your file in the page header:
Hi Thomas,
thanks for your great work.
I'm looking for a way to store a css file on the ESP in LittleFS instead of referencing a css file on an external link.
Any hints if this is currently possible?
Thanks
Chris
The text was updated successfully, but these errors were encountered: