WithPrefix returns a router that prefixes all registered routes with prefix.
(prefix string)
| 64 | |
| 65 | // WithPrefix returns a router that prefixes all registered routes with prefix. |
| 66 | func (r *Router) WithPrefix(prefix string) *Router { |
| 67 | return &Router{rtr: r.rtr, prefix: r.prefix + prefix, instrh: r.instrh} |
| 68 | } |
| 69 | |
| 70 | // handle turns a HandlerFunc into an httprouter.Handle. |
| 71 | func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handle { |