I want to achieve routes like
user/profile
user/cart
user/products
Currently, I'm doing this
r.HandleFunc("user/signup", signupHandler).Methods("POST")
r.HandleFunc("user/signin", signinHandler).Methods("POST")
r.HandleFunc("user/profile", profileHandler).Methods("GET")
r.HandleFunc("user/cart", cartHandler).Methods("POST")
r.HandleFunc("user/products", productsHandler).Methods("GET")
As you can see these routes starts with user
so can how can I know it's a user
routes so I can send handle it in a different file.
I want something like
r.HandleFunc("user/", handlerWhichHandelAllTheRequestFromUser)
It should handle all the URL which starts from users
.
I'm using mux gorilla