mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 20:07:04 +00:00
Add fallback handlers
Former-commit-id: f7e9bd17076a10e1ed1702780d7ce9e89f00b592
This commit is contained in:
@@ -905,6 +905,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
|
||||
|
||||
Reference in New Issue
Block a user