Also added sub-path to an example in the README.md.
This commit is contained in:
parent
d9e5024d4d
commit
468606e4fd
@ -24,6 +24,12 @@ This router is used like many others., example:
|
|||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s := r.Sub("/api/v1")
|
||||||
|
|
||||||
|
s.Handler(http.MethodGet, "/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
...
|
||||||
|
})
|
||||||
|
|
||||||
if err := http.ListenAndServe(":8000", r); err != nil {
|
if err := http.ListenAndServe(":8000", r); err != nil {
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user