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
Routes are tested in the order they were added to the router. If two routes match, the first one wins:
139
+
140
+
```go
141
+
r:= mux.NewRouter()
142
+
r.HandleFunc("/specific", specificHandler)
143
+
r.PathPrefix("/").Handler(catchAllHandler)
144
+
```
145
+
138
146
Setting the same matching conditions again and again can be boring, so we have a way to group several routes that share the same requirements. We call it "subrouting".
139
147
140
148
For example, let's say we have several URLs that should only match when the host is `www.example.com`. Create a route for that host and get a "subrouter" from it:
0 commit comments