1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 13:05:56 +00:00

Add error message when reverse routing using gorillamux happens before boot

Former-commit-id: 96dd812a16338824474ba1be0db18c486b2ebc0d
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-02-18 08:18:09 +02:00
parent e4079e4c67
commit 9597fab37c
4 changed files with 60 additions and 35 deletions

View File

@@ -43,9 +43,18 @@ func main() {
games.Post("/{gameID:[0-9]+}/clans/{clanPublicID:[0-9]+}/memberships/demote", h)
}
app.Get("/anything/{anythingparameter:.*}", func(ctx *iris.Context) {
myroute := app.Get("/anything/{anythingparameter:.*}", func(ctx *iris.Context) {
s := ctx.Param("anythingparameter")
ctx.Writef("The path after /anything is: %s", s)
}) // .ChangeName("myroute")
app.Get("/reverse_myroute", func(ctx *iris.Context) {
// reverse routing snippet using templates:
// https://github.com/kataras/iris/tree/v6/adaptors/view/_examples/template_html_3 (gorillamux)
// https://github.com/kataras/iris/tree/v6/adaptors/view/_examples/template_html_4 (httprouter)
myrouteRequestPath := app.Path(myroute.Name(), "anythingparameter", "something/here")
ctx.Writef("Should be '/anything/something/here': %s", myrouteRequestPath)
})
p := app.Party("mysubdomain.")