1
0
mirror of https://github.com/kataras/iris.git synced 2026-03-08 09:25:58 +00:00

add 'Configuration.PathIntelligence' and 'OnErrorCode' and 'OnAnyErrorCode' on APIContainer

Former-commit-id: bc3d0232106622063205f326bfa4ed3aa84179de
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-05-17 08:10:07 +03:00
parent 21a013569f
commit 1e20996330
10 changed files with 104 additions and 27 deletions

View File

@@ -351,7 +351,7 @@ type Context interface {
// this request based on subdomain and request path.
//
// Order may change.
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/not-found-suggests
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/intelligence/manual
FindClosest(n int) []string
// IsWWW returns true if the current subdomain (if any) is www.
IsWWW() bool
@@ -1812,7 +1812,7 @@ func (ctx *context) Subdomain() (subdomain string) {
// this request based on subdomain and request path.
//
// Order may change.
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/not-found-suggests
// Example: https://github.com/kataras/iris/tree/master/_examples/routing/intelligence/manual
func (ctx *context) FindClosest(n int) []string {
return ctx.Application().FindClosestPaths(ctx.Subdomain(), ctx.Path(), n)
}