-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
I searched through the issues but couldn't find anything for sub routers with paths. I don't care about subdomains.
My use case is for API versioning. Here is a snippet from the Gorilla mux:
r := mux.NewRouter()
s := r.PathPrefix("/products").Subrouter()
// "/products/"
s.HandleFunc("/", ProductsHandler)
// "/products/{key}/"
s.HandleFunc("/{key}/", ProductHandler)
// "/products/{key}/details"
s.HandleFunc("/{key}/details", ProductDetailsHandler)It would be sweet to have a sub router for each version prefix. Is this currently possible or something you could add?
Forgive me if I missed something in the README or documentation.