iris/_examples/http_responsewriter/herotemplate
2020-03-05 22:41:27 +02:00
..
template formatting 2019-08-17 10:06:20 +03:00
app.go examples: replace all app.Run(iris.Addr(...)) with app.Listen just for the shake of simplicity, both are doing the same exact thing as it's described on the http listening first example. 2020-03-05 22:41:27 +02:00
README.md create a new package, name it as hero, I was thinking super or superb but hero is better name for what it does - the goal is to split the new 'mvc handlers' from the mvc system because they are not the same, users should know that they can use these type of rich binded handlers without controllers as well, like a normal handler and that I implemented here, the old files exist on the mvc package but will be removed at the next commit, I have to decide if we want type aliases for Result or no 2017-12-25 20:05:32 +02: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