New returns a new initialized Router. Path auto-correction, including trailing slashes, is enabled by default.
()
| 190 | // New returns a new initialized Router. |
| 191 | // Path auto-correction, including trailing slashes, is enabled by default. |
| 192 | func New() *Router { |
| 193 | return &Router{ |
| 194 | RedirectTrailingSlash: true, |
| 195 | RedirectFixedPath: true, |
| 196 | HandleMethodNotAllowed: true, |
| 197 | HandleOPTIONS: true, |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | // GET is a shortcut for router.Handle(http.MethodGet, path, handle) |
| 202 | func (r *Router) GET(path string, handle Handle) { |
no outgoing calls