1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-23 04:47:02 +00:00

more route info improvements

Former-commit-id: ccbe95de0badb1bf448fcc443cecda60772716dc
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-04-28 22:34:36 +03:00
parent 128cd255cb
commit 2a4043a3c2
14 changed files with 147 additions and 61 deletions

View File

@@ -399,7 +399,7 @@ func (api *APIBuilder) HandleDir(requestPath, directory string, opts ...DirOptio
for _, route := range routes {
if route.Method == http.MethodHead {
} else {
route.SetDescription(description)
route.Describe(description)
route.SetSourceLine(fileName, lineNumber)
}
@@ -453,6 +453,7 @@ func (api *APIBuilder) CreateRoutes(methods []string, relativePath string, handl
// before join the middleware + handlers + done handlers and apply the execution rules.
mainHandlerName, mainHandlerIndex := context.MainHandlerName(mainHandlers)
mainHandlerFileName, mainHandlerFileNumber := context.HandlerFileLineRel(handlers[mainHandlerIndex])
// re-calculate mainHandlerIndex in favor of the middlewares.
@@ -939,7 +940,7 @@ func (api *APIBuilder) Favicon(favPath string, requestPath ...string) *Route {
reqPath = requestPath[0]
}
return api.registerResourceRoute(reqPath, h).SetDescription(description)
return api.registerResourceRoute(reqPath, h).Describe(description)
}
// OnErrorCode registers an error http status code