mirror of
https://github.com/kataras/iris.git
synced 2026-01-24 12:25:57 +00:00
reorganization of _examples and add some new examples such as iris+groupcache+mysql+docker
Former-commit-id: ed635ee95de7160cde11eaabc0c1dcb0e460a620
This commit is contained in:
26
_examples/view/herotemplate/README.md
Normal file
26
_examples/view/herotemplate/README.md
Normal 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
|
||||
Reference in New Issue
Block a user