From 25dd285539d75cba8da6a34b4c2ff3bebbad49e5 Mon Sep 17 00:00:00 2001 From: Jorrit Klein Bramel Date: Sun, 22 Jul 2018 15:58:21 +0200 Subject: [PATCH] add routes function to http context (#649) --- context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/context.go b/context.go index 720c4251..b22e55d2 100644 --- a/context.go +++ b/context.go @@ -95,6 +95,12 @@ func (c *Context) Handler() HandlerFunc { return c.handlers.Last() } +// Routes returns a slice of registered routes, including some useful information, such as: +// the http method, path and the handler name. +func (c *Context) Routes() RoutesInfo { + return c.engine.Routes() +} + /************************************/ /*********** FLOW CONTROL ***********/ /************************************/