Hi guys,
I am using microdot as the web server on ESP32, according example gpio.html: href="https://stackpath.bootstrapcdn.com/boot ... ap.min.css" , i downloaed the css file to local, and change the code to :
href="bootstrap.min.css" , after running got error message:
GET bootstrap.min.css 404
Microdot cann't read local css files
Re: Microdot cann't read local css files
The example doesn't have any code in it to respond to anything other than "/" (where it returns gpio.html for a GET, and handles the form for a POST). You'll need to add a handler for "/bootstrap.min.css" that uses send_file to return the CSS.
-
- Posts: 4
- Joined: Tue Nov 03, 2020 3:18 am
Re: Microdot cann't read local css files
Thank you very much , it worked
-
- Posts: 7
- Joined: Mon Feb 12, 2018 9:52 pm
Re: Microdot cann't read local css files
hey @jimmo, the method you've described worked for me as well, thanks ! However I can't make the Font Awesome working...
I have saved the 'solid.min.css' file in one folder called 'src' (by the way, also where my working css style file is located) and created a handler for that. I addition, I've copied the 'webfonts' folder at the same level as the 'src', as explained here:
https://stackoverflow.com/questions/254 ... -using-cdn
However, the fonts are not being displayed... do I need a handler for each of the files in the 'webfonts' folder? I would appreciate any help on that!
I have saved the 'solid.min.css' file in one folder called 'src' (by the way, also where my working css style file is located) and created a handler for that. I addition, I've copied the 'webfonts' folder at the same level as the 'src', as explained here:
https://stackoverflow.com/questions/254 ... -using-cdn
However, the fonts are not being displayed... do I need a handler for each of the files in the 'webfonts' folder? I would appreciate any help on that!