Subdomains
Subdomain(subdomain string, middleware ...Handler) PartyWildcardSubdomain(middleware ...Handler) Party// [app := iris.New...]
admin := app.Subdomain("admin")
// admin.mydomain.com
admin.Get("/", func(ctx iris.Context) {
ctx.Writef("INDEX FROM admin.mydomain.com")
})
// admin.mydomain.com/hey
admin.Get("/hey", func(ctx iris.Context) {
ctx.Writef("HEY FROM admin.mydomain.com/hey")
})
// [other routes here...]
app.Listen("mydomain.com:80")Last updated
Was this helpful?