We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there,
The Heartbeat middleware is not invoked when attached to a sub router, whereas other middlewares are.
The expected behaviour would be that /connectivity/ping would return 200. Instead, a 404 is returned.
/connectivity/ping
200
404
package main import ( "net/http" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" ) func main() { r := chi.NewRouter() r.Use(middleware.RequestID) r.Use(middleware.RealIP) r.Use(middleware.Recoverer) r.Mount("/connectivity", NewSubrouter()) http.ListenAndServe(":3333", r) } func NewSubrouter() chi.Router { r := chi.NewRouter() r.Use(middleware.Logger) r.Use(middleware.Heartbeat("/ping")) r.Get("/", func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(".")) }) return r }
Best, Moritz
The text was updated successfully, but these errors were encountered:
I created PR for this issue, please check
Sorry, something went wrong.
Please see #822 (review)
No branches or pull requests
Hi there,
The Heartbeat middleware is not invoked when attached to a sub router, whereas other middlewares are.
The expected behaviour would be that
/connectivity/ping
would return200
. Instead, a404
is returned.Best,
Moritz
The text was updated successfully, but these errors were encountered: