1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-24 20:14:31 +02:00

Added a method to return routers map

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2019-04-28 22:49:18 -07:00
parent c8e923cf54
commit 46ae04bef2

View File

@ -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) {