1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-08 20:41:57 +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

@@ -24,10 +24,7 @@ func TestSubdomainRedirectWWW(t *testing.T) {
}
for _, test := range tests {
req := e.GET(test.path)
// req.WithURL("http://www." + root)
req.Expect().Status(httptest.StatusOK).Body().Equal(test.response)
e.GET(test.path).Expect().Status(httptest.StatusOK).Body().Equal(test.response)
}
}

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(;)).

View File

@@ -41,13 +41,13 @@ func TestSubdomainWWW(t *testing.T) {
}
host := "localhost:1111"
e := httptest.New(t, app, httptest.URL("http://"+host))
e := httptest.New(t, app, httptest.URL("http://"+host), httptest.Debug(false))
for _, test := range tests {
req := e.Request(test.method, test.path)
if subdomain := test.subdomain; subdomain != "" {
req.WithURL("http://" + subdomain + "." + host)
req = req.WithURL("http://" + subdomain + "." + host)
}
req.Expect().