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

NEW Feature: Fallback handlers by @ZaniaDeveloper via PR: #909

Relative: https://github.com/kataras/iris/issues/884 and https://github.com/iris-contrib/middleware/issues/32
Former-commit-id: 5d79d9fbb5792521ee707ba513cb40681438ea6f
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-02-23 02:24:14 +02:00
committed by GitHub
13 changed files with 406 additions and 9 deletions

View File

@@ -904,6 +904,9 @@ type Context interface {
// It's for extreme use cases, 99% of the times will never be useful for you.
Exec(method string, path string)
// RouteExists checks if a route exists
RouteExists(method string, path string) bool
// Application returns the iris app instance which belongs to this context.
// Worth to notice that this function returns an interface
// of the Application, which contains methods that are safe
@@ -3130,6 +3133,11 @@ func (ctx *context) Exec(method string, path string) {
}
}
// RouteExists checks if a route exists
func (ctx *context) RouteExists(method string, path string) bool {
return ctx.Application().RouteExists(method, path, ctx)
}
// Application returns the iris app instance which belongs to this context.
// Worth to notice that this function returns an interface
// of the Application, which contains methods that are safe