Skip to content

Commit 46ae04b

Browse files
committed
Added a method to return routers map
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent c8e923c commit 46ae04b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

echo.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,16 @@ func (e *Echo) NewContext(r *http.Request, w http.ResponseWriter) Context {
325325
}
326326
}
327327

328-
// Router returns router.
328+
// Router returns the default router.
329329
func (e *Echo) Router() *Router {
330330
return e.router
331331
}
332332

333+
// Routers returns the map of host => router.
334+
func (e *Echo) Routers() map[string]*Router {
335+
return e.routers
336+
}
337+
333338
// DefaultHTTPErrorHandler is the default HTTP error handler. It sends a JSON response
334339
// with status code.
335340
func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) {

0 commit comments

Comments
 (0)