Help me understand adafruit_httpserver. For this code that's from the examples:
import socketpool
import wifi
from adafruit_httpserver import Server, Request, FileResponse
pool = socketpool.SocketPool(wifi.radio)
server = Server(pool, "/static", debug=True)
@server.route("/home")
def home(request: Request):
print("home route:", request)
return FileResponse(request, "home.html", root_path="/www")
server.serve_forever(str(wifi.radio.ipv4_address))
When serving the request, the print() is not executed. Why could this be?
Also the root_path argument is not used. (e.g. the full file path the server tries to vend is /static/home.html). From what I can tell, server.py is constructing its own FileResponse instead of using my handler https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer/blob/main/adafruit_httpserver/server.py#L317
In fact, it seems to be ignoring that @server.route(), falling back to the default mapping of route path -> constructed html filename
