mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 13:05:56 +00:00
Add comments on Quick Look and fill the updater TODO
This commit is contained in:
20
README.md
20
README.md
@@ -33,11 +33,15 @@ The <a href="https://github.com/kataras/iris#benchmarks">fastest</a> backend web
|
|||||||
Easy to <a href="https://www.gitbook.com/book/kataras/iris/details">learn</a>, while it's highly customizable. <br/>
|
Easy to <a href="https://www.gitbook.com/book/kataras/iris/details">learn</a>, while it's highly customizable. <br/>
|
||||||
Ideally suited for both experienced and novice <b>Developers</b>.
|
Ideally suited for both experienced and novice <b>Developers</b>.
|
||||||
<br/>
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
<img src="https://raw.githubusercontent.com/smallnest/go-web-framework-benchmark/4db507a22c964c9bc9774c5b31afdc199a0fe8b7/benchmark.png" href="#benchmarks" alt="Benchmark Wizzard July 21, 2016- Processing Time Horizontal Graph" />
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Quick Look
|
Quick Look
|
||||||
------------
|
------------
|
||||||
|
|
||||||
@@ -47,8 +51,10 @@ package main
|
|||||||
import "github.com/kataras/iris"
|
import "github.com/kataras/iris"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
// serve static files, just a fav here
|
||||||
iris.Favicon("./favicon.ico")
|
iris.Favicon("./favicon.ico")
|
||||||
|
|
||||||
|
// handle "/" - HTTP METHOD: "GET"
|
||||||
iris.Get("/", func(ctx *iris.Context) {
|
iris.Get("/", func(ctx *iris.Context) {
|
||||||
ctx.Render("index.html")
|
ctx.Render("index.html")
|
||||||
})
|
})
|
||||||
@@ -57,6 +63,7 @@ func main() {
|
|||||||
ctx.Render("login.html", iris.Map{"Title": "Login Page"})
|
ctx.Render("login.html", iris.Map{"Title": "Login Page"})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// handle "/login" - HTTP METHOD: "POST"
|
||||||
iris.Post("/login", func(ctx *iris.Context) {
|
iris.Post("/login", func(ctx *iris.Context) {
|
||||||
secret := ctx.PostValue("secret")
|
secret := ctx.PostValue("secret")
|
||||||
ctx.Session().Set("secret", secret)
|
ctx.Session().Set("secret", secret)
|
||||||
@@ -64,6 +71,17 @@ func main() {
|
|||||||
ctx.Redirect("/user")
|
ctx.Redirect("/user")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// handle websocket connections
|
||||||
|
iris.Config.Websocket.Endpoint = "/mychat"
|
||||||
|
iris.Websocket.OnConnection(func(c iris.WebsocketConnection) {
|
||||||
|
c.Join("myroom")
|
||||||
|
|
||||||
|
c.On("chat", func(message string){
|
||||||
|
c.To("myroom").Emit("chat", "From "+c.ID()+": "+message)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
// serve requests at http://localhost:8080
|
||||||
iris.Listen(":8080")
|
iris.Listen(":8080")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -195,7 +213,7 @@ Todo
|
|||||||
------------
|
------------
|
||||||
- [x] Use of the standard `log.Logger` instead of the `iris-contrib/logger`(colorful logger), make these changes to all middleware, examples and plugins.
|
- [x] Use of the standard `log.Logger` instead of the `iris-contrib/logger`(colorful logger), make these changes to all middleware, examples and plugins.
|
||||||
- [x] Implement, even, a better way to manage configuration/options, devs will be able to set their own custom options inside there. ` I'm thinking of something the last days, but it will have breaking changes. `
|
- [x] Implement, even, a better way to manage configuration/options, devs will be able to set their own custom options inside there. ` I'm thinking of something the last days, but it will have breaking changes. `
|
||||||
- [ ] Implement an internal updater, as requested [here](https://github.com/kataras/iris/issues/401).
|
- [x] Implement an internal updater, as requested [here](https://github.com/kataras/iris/issues/401).
|
||||||
|
|
||||||
Iris is a **Community-Driven** Project, waiting for your suggestions and [feature requests](https://github.com/kataras/iris/issues?utf8=%E2%9C%93&q=label%3A%22feature%20request%22)!
|
Iris is a **Community-Driven** Project, waiting for your suggestions and [feature requests](https://github.com/kataras/iris/issues?utf8=%E2%9C%93&q=label%3A%22feature%20request%22)!
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user