1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

add a nested parties and wildcard subdomains test

Former-commit-id: c2faa1bd02935ef13c32027f99c097b5c60babef
This commit is contained in:
kataras
2017-08-23 15:26:46 +03:00
parent 531ca5829c
commit 8b5b6b116a
2 changed files with 37 additions and 0 deletions

View File

@@ -55,6 +55,32 @@ func registerGamesRoutes(app *iris.Application) {
games.Post("/{gameID:int}/clans/{clanPublicID:int}/memberships/delete", h)
games.Post("/{gameID:int}/clans/{clanPublicID:int}/memberships/promote", h)
games.Post("/{gameID:int}/clans/{clanPublicID:int}/memberships/demote", h)
gamesCh := games.Party("/challenge")
{
// games/challenge
gamesCh.Get("/", h)
gamesChBeginner := gamesCh.Party("/beginner")
{
// games/challenge/beginner/start
gamesChBeginner.Get("/start", h)
levelBeginner := gamesChBeginner.Party("/level")
{
// games/challenge/beginner/level/first
levelBeginner.Get("/first", h)
}
}
gamesChIntermediate := gamesCh.Party("/intermediate")
{
// games/challenge/intermediate
gamesChIntermediate.Get("/", h)
// games/challenge/intermediate/start
gamesChIntermediate.Get("/start", h)
}
}
}
}
@@ -62,6 +88,10 @@ func registerSubdomains(app *iris.Application) {
mysubdomain := app.Party("mysubdomain.")
// http://mysubdomain.myhost.com
mysubdomain.Get("/", h)
willdcardSubdomain := app.Party("*.")
willdcardSubdomain.Get("/", h)
willdcardSubdomain.Party("/party").Get("/", h)
}
func newApp() *iris.Application {