Sending .css and font in addition to index.html #13463
Unanswered
designrulesco
asked this question in
ESP32
Replies: 1 comment
-
Hi |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all - had one more question on the captive portal I'm using (made by metachris (https://github.com/metachris/micropython-captiveportal)) to have the user connect to the ESP32 and provide credentials for their WiFi network.
Things are looking good, but I'd like to also serve the client style.css and a font file so that I can really customize the look of the page away from a simple barebones HTML page. I changed my css to be in-line on the HTML to avoid figuring out how to serve the .css, but I can't avoid serving the font file (I think?) so I'm back to figuring out how to serve them both.
The captive portal code just serves index.html - I've tried to modify it to also serve the css file (before trying to do the same for the font file) but without much success. Wondering if anybody can advise how to best make this change..
Full code of the function that handles http requests:
My one attempt to modify the "handle the request" section to also serve up "style.css" - note that this broke the captive portal functionality.
Lastly, I tried simply using the existing code and reading/printing the style.css file before (or after) the html file but that just dumped the text of the files onto the page instead of rendering it on the client.
Definitely a little out of my element so appreciate the help!
Beta Was this translation helpful? Give feedback.
All reactions