1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-23 04:47:02 +00:00

examples: use ctx.ResponseWriter().Naive().(http.Pusher) instead

Former-commit-id: 7802f4eadf2b1c0a0d2a42ed5ebac3e5c77f88cc
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-07-24 22:36:46 +03:00
parent a4efb222cc
commit 2f8b29cb3d
6 changed files with 18 additions and 82 deletions

View File

@@ -97,8 +97,11 @@ func main() {
}
app.Get("/", func(ctx iris.Context) {
ctx.View("todos/index.jet", todos) // <--
err := ctx.View("todos/index.jet", todos) // <--
// Note that the `ctx.View` already logs the error if logger level is allowing it and returns the error.
if err != nil {
ctx.StopWithText(iris.StatusInternalServerError, "Templates not rendered!")
}
})
app.Get("/todo", func(ctx iris.Context) {