From 7fd8baea754f2d3e452d318d5d7961fb4d093a35 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Mon, 12 Feb 2018 04:04:46 +0200 Subject: [PATCH] README.md: make backers visible on the top of the page, replaced the prev api to the https://iris-go.com/backers.svg in order this to happens Former-commit-id: 093f11d05fe9556c79de2cb2886e5d0569f27336 --- .github/ISSUE_TEMPLATE.md | 3 +-- CONTRIBUTING.md | 15 +++----------- README.md | 4 ++-- README_GR.md | 4 ++-- README_RU.md | 4 ++-- README_ZH.md | 4 ++-- _examples/http_request/read-json/main.go | 20 +++++++++++++++++++ _examples/routing/reverse/main.go | 5 ++++- _examples/view/template_html_4/main.go | 6 ++++++ .../view/template_html_4/templates/page.html | 14 +++++++++++++ 10 files changed, 56 insertions(+), 23 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index e03f3558..5fc7c444 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,6 +4,5 @@ Examples for the Iris project can be found at Documentation for the Iris project can be found at . -Love iris? Please consider supporting our collective: -👉 https://opencollective.com/iris/donate +Love iris? Please consider supporting the project: 👉 https://iris-go.com/donate \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 33d7b9c0..e8c1cb38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -77,24 +77,15 @@ If you want to be part of this and you've time for collaboration, please open a All new contributors of that book will receive prizes! -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/iris). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - -## Credits - - ### Contributors -Thank you to all the people who have already contributed to iris! - +Thank you to all the people who have already contributed to Iris! ### Backers -Thank you to all our backers! [Become a backer](https://opencollective.com/iris#backer) +Thank you to all our backers! [Become a backer](https://iris-go.com/donate) - + ### Sponsors diff --git a/README.md b/README.md index 18d96ac9..c97cd6fb 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,9 @@ Learn what [others say about Iris](#support) and [star](https://github.com/katar ## Backers -Thank you to all our backers! 🙏 [Become a backer](https://opencollective.com/iris#backer) +Thank you to all our backers! 🙏 [Become a backer](https://iris-go.com/donate) - + ```sh $ cat example.go diff --git a/README_GR.md b/README_GR.md index 365ef6af..44573314 100644 --- a/README_GR.md +++ b/README_GR.md @@ -14,9 +14,9 @@ ## Yποστηρικτές -Eυχαριστούμε όλους τους υποστηρικτές μας! 🙏 [Γίνετε ένας από αυτούς](https://opencollective.com/iris#backer) +Eυχαριστούμε όλους τους υποστηρικτές μας! 🙏 [Γίνετε ένας από αυτούς](https://iris-go.com/donate) - + ```sh $ cat example.go diff --git a/README_RU.md b/README_RU.md index 3476ecab..8c400c87 100644 --- a/README_RU.md +++ b/README_RU.md @@ -14,9 +14,9 @@ Iris предоставляет красиво выразительную и у ## Сторонники -Спасибо всем, кто поддерживал нас! 🙏 [Поддержать нас](https://opencollective.com/iris#backer) +Спасибо всем, кто поддерживал нас! 🙏 [Поддержать нас](https://iris-go.com/donate) - + ```sh $ cat example.go diff --git a/README_ZH.md b/README_ZH.md index 1f3930d9..2277d732 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -14,9 +14,9 @@ Iris 功能强大、使用简单,它将会是你下一个网站、API 服务 ## 支持者 -感谢所有的支持者! 🙏 [支持我们](https://opencollective.com/iris#backer) +感谢所有的支持者! 🙏 [支持我们](https://iris-go.com/donate) - + ```sh $ cat example.go diff --git a/_examples/http_request/read-json/main.go b/_examples/http_request/read-json/main.go index b90f9da7..fb4ff396 100644 --- a/_examples/http_request/read-json/main.go +++ b/_examples/http_request/read-json/main.go @@ -21,10 +21,30 @@ func MyHandler(ctx iris.Context) { ctx.Writef("Received: %#v\n", c) } +type Person struct { + Name string `json:"name"` + Age int `json:"age"` +} + +// MyHandler2 reads a collection of Person from JSON post body. +func MyHandler2(ctx iris.Context) { + var persons []Person + err := ctx.ReadJSON(&persons) + + if err != nil { + ctx.StatusCode(iris.StatusBadRequest) + ctx.WriteString(err.Error()) + return + } + + ctx.Writef("Received: %#+v\n", persons) +} + func main() { app := iris.New() app.Post("/", MyHandler) + app.Post("/slice", MyHandler2) // use Postman or whatever to do a POST request // to the http://localhost:8080 with RAW BODY: diff --git a/_examples/routing/reverse/main.go b/_examples/routing/reverse/main.go index 7867be86..1ab53c11 100644 --- a/_examples/routing/reverse/main.go +++ b/_examples/routing/reverse/main.go @@ -32,6 +32,9 @@ func main() { // http://localhost:8080/reverse_myroute // http://localhost:8080/execute_myroute // http://localhost:8080/anything/any/path/here + // + // See view/template_html_4 example for more reverse routing examples + // using the reverse router component and the {{url}} and {{urlpath}} template functions. app.Run(iris.Addr(":8080")) -} // See view/template_html_4 example for more. +} diff --git a/_examples/view/template_html_4/main.go b/_examples/view/template_html_4/main.go index a15a4d18..4484adf8 100644 --- a/_examples/view/template_html_4/main.go +++ b/_examples/view/template_html_4/main.go @@ -56,6 +56,12 @@ func main() { } }) + // simple path so you can test it without host mapping and subdomains, + // at view it make uses of {{urlpath ...}} + // in order to showcase you that you can use it + // if you don't want the entire scheme and host to be part of the url. + app.Get("/mypath7/{paramfirst}/{paramsecond}/static/{paramthird}", emptyHandler).Name = "my-page7" + // http://127.0.0.1:8080 app.Run(iris.Addr(host)) } diff --git a/_examples/view/template_html_4/templates/page.html b/_examples/view/template_html_4/templates/page.html index f4f605be..9e35dc37 100644 --- a/_examples/view/template_html_4/templates/page.html +++ b/_examples/view/template_html_4/templates/page.html @@ -4,26 +4,40 @@ is the subdomain part instead of named parameter--> username1.127.0.0.1:8080/mypath

+ username2.127.0.0.1:8080/mypath2/{paramfirst}/{paramsecond}

+ username3.127.0.0.1:8080/mypath3/{paramfirst}/statichere/{paramsecond}

+ username4.127.0.0.1:8080/mypath4/{paramfirst}/statichere/{paramsecond}/{otherParam}/{something:path}

+ username5.127.0.0.1:8080/mypath5/{paramfirst}/statichere/{paramsecond}/{otherparam}/anything/{something:path}

+ username5.127.0.0.1:8080/mypath6/{paramfirst}/{paramsecond}/staticParam/{paramThirdAfterStatic} +
+
+ + + mypath7/{paramfirst}/{paramsecond}/static/{paramthird} + +
+
+