1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

add iris.Minify middleware and Context.OnCloseErr/OnConnectionCloseErr

This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-08-15 17:21:57 +03:00
parent ab226d925a
commit ef7d365e81
10 changed files with 178 additions and 4 deletions

View File

@@ -9,11 +9,18 @@ func main() {
func newApp() *iris.Application {
app := iris.New()
// Create the "test.mydomain.com" subdomain.
test := app.Subdomain("test")
// Register views for the test subdomain.
test.RegisterView(iris.HTML("./views", ".html").
Layout("layouts/test.layout.html"))
// Optionally, to minify the HTML5 error response.
// Note that minification might be slower, caching is advised.
test.UseError(iris.Minify)
// Register error code 404 handler.
test.OnErrorCode(iris.StatusNotFound, handleNotFoundTestSubdomain)
test.Get("/", testIndex)
return app