iris/_examples/view/herotemplate
Gerasimos (Makis) Maropoulos 0f113dfcda (#1554) Add support for all common compressions (write and read)
- Remove the context.Context interface and export the *context, the iris.Context now points to the pointer\nSupport compression and rate limiting in the FileServer\nBit of code organisation


Former-commit-id: ad1c61bf968059510c6be9e7f2cceec7da70ba17
2020-07-10 23:21:09 +03:00
..
template reorganization of _examples and add some new examples such as iris+groupcache+mysql+docker 2020-06-07 15:26:06 +03:00
app.go (#1554) Add support for all common compressions (write and read) 2020-07-10 23:21:09 +03:00
README.md reorganization of _examples and add some new examples such as iris+groupcache+mysql+docker 2020-06-07 15:26:06 +03:00

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:

if _, err := w.Write(buffer.Bytes()); err != nil {
// and
template.UserListToWriter(userList, w)

To:

if _, err := ctx.Write(buffer.Bytes()); err != nil {
// and
template.UserListToWriter(userList, ctx)

So easy.

Read more at: https://github.com/shiyanhui/hero