mirror of
https://github.com/kataras/iris.git
synced 2025-02-10 11:06:19 +01:00
Update readme
This commit is contained in:
parent
20e323b31d
commit
74bbc34d5b
49
README.md
49
README.md
|
@ -18,12 +18,40 @@
|
||||||
[Language]: http://golang.org
|
[Language]: http://golang.org
|
||||||
[Platform Widget]: https://img.shields.io/badge/platform-Any--OS-gray.svg?style=flat-square
|
[Platform Widget]: https://img.shields.io/badge/platform-Any--OS-gray.svg?style=flat-square
|
||||||
|
|
||||||
the fastest web framework for Go while providing robust set of features for building modern web applications.
|
The fastest web framework for Go.
|
||||||
|
|
||||||
[![Benchmark Wizzard Processing Time Horizontal Graph](https://raw.githubusercontent.com/iris-contrib/website/cf71811e6acb2f9bf1e715e25660392bf090b923/assets/benchmark_horizontal_transparent.png)](https://github.com/smallnest/go-web-framework-benchmark)
|
[![Benchmark Wizzard Processing Time Horizontal Graph](https://raw.githubusercontent.com/iris-contrib/website/cf71811e6acb2f9bf1e715e25660392bf090b923/assets/benchmark_horizontal_transparent.png)](https://github.com/smallnest/go-web-framework-benchmark)
|
||||||
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ cat main.go
|
$ cat test_json.go
|
||||||
|
```
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/kataras/iris"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
// render JSON
|
||||||
|
iris.Get("/hi_json", func(c *iris.Context) {
|
||||||
|
c.JSON(iris.StatusOK, iris.Map{
|
||||||
|
"Name": "Iris",
|
||||||
|
"Born": "13 March 2016",
|
||||||
|
"Stars": 2440,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
iris.Listen(":8080")
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> Learn about [configuration](https://kataras.gitbooks.io/iris/content/configuration.html) and [render](https://kataras.gitbooks.io/iris/content/render.html).
|
||||||
|
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ cat test_party.go
|
||||||
```
|
```
|
||||||
```go
|
```go
|
||||||
package main
|
package main
|
||||||
|
@ -34,16 +62,6 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
// render JSON
|
|
||||||
iris.Get("/hi_json", func(c *iris.Context) {
|
|
||||||
c.JSON(iris.StatusOK, iris.Map{
|
|
||||||
"Name": "Iris",
|
|
||||||
"Born": "13 March 2016",
|
|
||||||
"Stars": 2380,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
// logger middleware
|
// logger middleware
|
||||||
log := logger.New(iris.Logger)
|
log := logger.New(iris.Logger)
|
||||||
|
|
||||||
|
@ -87,7 +105,7 @@ func main() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
iris.Listen("127.0.0.1:8080")
|
iris.Listen(":8080")
|
||||||
}
|
}
|
||||||
|
|
||||||
// using high level sessions inside a custom middleware
|
// using high level sessions inside a custom middleware
|
||||||
|
@ -102,10 +120,7 @@ func myAuthMiddleware(c *iris.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
> Learn about [named parameters](https://kataras.gitbooks.io/iris/content/named-parameters.html), [parties](https://kataras.gitbooks.io/iris/content/party.html) and [subdomains](https://kataras.gitbooks.io/iris/content/subdomains.html).
|
||||||
> Learn about [configuration](https://kataras.gitbooks.io/iris/content/configuration.html) and [render](https://kataras.gitbooks.io/iris/content/render.html).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user