You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I might have missed but couldn't see anything so just asking. Are we able to name the routes - similar to this? See example below for better explanation.
Thanks
// Setr.Post("/users", createUser).SetName("create_user")
// Get in the controller...(w http.ResponseWriter, r*http.Request) {
name:=chi.RouteName(r)
}
The text was updated successfully, but these errors were encountered:
Thanks for the request, but chi's goals are to remain a minimal router -- however, you can already do this today:
You can pull it off with your own custom middleware and use r.With(SetName("create_user")).Post("/users", createUser) .. this would work out of the box now. https://github.com/go-chi/chi/blob/master/middleware/value.go#L9-L17 here is a simple middleware you could adapt.. but if you wanted to use middleware.Value directly for the above you could do ..
Hi,
Maybe I might have missed but couldn't see anything so just asking. Are we able to name the routes - similar to this? See example below for better explanation.
Thanks
The text was updated successfully, but these errors were encountered: