In my root handle ("/") or clients handle ("/clients") the static files are correctly avaliable, and looking the network tab on chrome, i see the server request like this:
localhost:8080/static/file.example
But if i'm on the secondary handle ("/Clients/route"), don't work correctly, i see this:
localhost:8080/clients/static/file.example
The StripPrefix don't remove the "client" from the request.
func main() {
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("/static"))))
http.HandleFunc("/", index)
http.HandleFunc("/clients", controllers.MostrarClientes)
http.HandleFunc("/clientes/route", controllers.MainIndex)
http.ListenAndServe(":8080", nil)
-
<link rel="stylesheet" href="static/leaflet/leaflet.css" />
-
File tree: