I created a hostrouter like in the readme.
r := chi.NewRouter()
r.Get("/test", func(writer http.ResponseWriter, request *http.Request) {
//...
})
hr := hostrouter.New()
hr.Map("", r) // default
But always got 404s. Changed it to wildcard (hr.Map("*", r) ) and it worked. This took my quite some time to figure out, don't know if I'm missing something or not. But after inspecting the hostrouter .ServerHttp function, I suspect that is no "default" at all?
Maybe hr.Map("", apiRouter()) // default should be removed from the readme, or if I'm missing something then maybe update the readme to make it clearer?
I created a hostrouter like in the readme.
But always got 404s. Changed it to wildcard (
hr.Map("*", r)) and it worked. This took my quite some time to figure out, don't know if I'm missing something or not. But after inspecting the hostrouter .ServerHttp function, I suspect that is no "default" at all?Maybe
hr.Map("", apiRouter()) // defaultshould be removed from the readme, or if I'm missing something then maybe update the readme to make it clearer?