1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

add vscode extension link and badge | Some internal improvements (not completed yet)

Former-commit-id: 9bc94e90a2780ee81f8188509d98063fb3f2924b
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-01-25 03:16:49 +02:00
parent 243439af9d
commit bf13f7648a
16 changed files with 293 additions and 219 deletions

View File

@@ -30,19 +30,19 @@ func newApp() *iris.Application {
www := app.Party("www.")
{
// Just to show how you can get all routes and copy them to another
// party or subdomain:
// Get all routes that are registered so far, including all "Parties" and subdomains:
currentRoutes := app.GetRoutes()
// Register them to the www subdomain/vhost as well:
for _, r := range currentRoutes {
www.Handle(r.Method, r.Tmpl().Src, r.Handlers...)
}
// http://www.mydomain.com/hi
www.Get("/hi", func(ctx iris.Context) {
ctx.Writef("hi from www.mydomain.com")
})
// Just to show how you can get all routes and copy them to another
// party or subdomain:
// Get all routes that are registered so far, including all "Parties" but subdomains:
currentRoutes := app.GetRoutes()
// Register them to the www subdomain/vhost as well:
for _, r := range currentRoutes {
www.Handle(r.Method, r.Path, r.Handlers...)
}
}
// See also the "subdomains/redirect" to register redirect router wrappers between subdomains,
// i.e mydomain.com to www.mydomain.com (like facebook does for SEO reasons(;)).