Skip to content

Commit

Permalink
Added a method to return routers map
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <vr@labstack.com>
  • Loading branch information
vishr committed Apr 29, 2019
1 parent c8e923c commit 46ae04b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,16 @@ func (e *Echo) NewContext(r *http.Request, w http.ResponseWriter) Context {
}
}

// Router returns router.
// Router returns the default router.
func (e *Echo) Router() *Router {
return e.router
}

// Routers returns the map of host => router.
func (e *Echo) Routers() map[string]*Router {
return e.routers
}

// DefaultHTTPErrorHandler is the default HTTP error handler. It sends a JSON response
// with status code.
func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) {
Expand Down

0 comments on commit 46ae04b

Please sign in to comment.