1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +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

@@ -0,0 +1,24 @@
package main
import "github.com/kataras/iris/v12"
func main() {
app := iris.New()
app.Get("/home", handler)
app.Get("/contact", handler)
app.Get("/contract", handler)
// http://localhost:8080/home
// http://localhost:8080/hom
//
// http://localhost:8080/contact
// http://localhost:8080/cont
//
// http://localhost:8080/contract
// http://localhost:8080/contr
app.Listen(":8080", iris.WithPathIntelligence)
}
func handler(ctx iris.Context) {
ctx.Writef("Path: %s", ctx.Path())
}