mirror of
https://github.com/kataras/iris.git
synced 2025-12-24 05:17:03 +00:00
more route info improvements
Former-commit-id: ccbe95de0badb1bf448fcc443cecda60772716dc
This commit is contained in:
@@ -117,7 +117,15 @@ func (api *APIContainer) Done(handlersFn ...interface{}) {
|
||||
// See `OnError`, `RegisterDependency`, `Use`, `Done`, `Get`, `Post`, `Put`, `Patch` and `Delete` too.
|
||||
func (api *APIContainer) Handle(method, relativePath string, handlersFn ...interface{}) *Route {
|
||||
handlers := api.convertHandlerFuncs(relativePath, handlersFn...)
|
||||
return api.Self.Handle(method, relativePath, handlers...)
|
||||
route := api.Self.Handle(method, relativePath, handlers...)
|
||||
|
||||
// Fix main handler name and source modified by execution rules wrapper.
|
||||
route.MainHandlerName, route.MainHandlerIndex = context.MainHandlerName(handlersFn...)
|
||||
if len(handlersFn) > route.MainHandlerIndex {
|
||||
route.SourceFileName, route.SourceLineNumber = context.HandlerFileLineRel(handlersFn[route.MainHandlerIndex])
|
||||
}
|
||||
|
||||
return route
|
||||
}
|
||||
|
||||
// Get registers a route for the Get HTTP Method.
|
||||
|
||||
Reference in New Issue
Block a user