1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-11 05:55:57 +00:00

add a simple hero template example as requested at https://github.com/kataras/iris/issues/840

Former-commit-id: 1c65190d21a5febbbbad1b2b565f82f749278d48
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-14 06:11:37 +02:00
parent ea863914dc
commit 22504f01ef
11 changed files with 210 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
# Hero Template Example
This folder contains the iris version of the original hero's example: https://github.com/shiyanhui/hero/tree/master/examples/app.
Iris is 100% compatible with `net/http` so you don't have to change anything else
except the handler input from the original example.
The only inline handler's changes were:
From:
```go
if _, err := w.Write(buffer.Bytes()); err != nil {
// and
template.UserListToWriter(userList, w)
```
To:
```go
if _, err := ctx.Write(buffer.Bytes()); err != nil {
// and
template.UserListToWriter(userList, ctx)
```
So easy.
Read more at: https://github.com/shiyanhui/hero