mirror of
https://github.com/kataras/iris.git
synced 2025-03-15 05:16:28 +01:00
Add a tip with a link on how to change the default Router. Remove the comic, not everybody has houmor.
This commit is contained in:
parent
3782a2e679
commit
306a709c04
17
README.md
17
README.md
|
@ -39,19 +39,13 @@ If you're coming from <a href="https://nodejs.org/en/">Node.js</a> world, this i
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
When humor goes, there goes civilization
|
|
||||||
-----------
|
|
||||||
|
|
||||||
<p align="center">
|
What The Community Says
|
||||||
<img src="https://github.com/iris-contrib/website/raw/gh-pages/assets/comics/comic1.png" />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
What you say about Iris
|
|
||||||
-----------
|
-----------
|
||||||
[](https://www.youtube.com/watch?v=jGx0LkuUs4A)
|
[](https://www.youtube.com/watch?v=jGx0LkuUs4A)
|
||||||
[](https://www.youtube.com/watch?v=jGx0LkuUs4A)
|
[](https://www.youtube.com/watch?v=jGx0LkuUs4A)
|
||||||
|
|
||||||
> [click here](https://www.youtube.com/watch?v=jGx0LkuUs4A) to see more of them.
|
> [navigate here](https://www.youtube.com/watch?v=jGx0LkuUs4A) to view all Go Community's reactions.
|
||||||
|
|
||||||
|
|
||||||
Feature Overview
|
Feature Overview
|
||||||
|
@ -60,6 +54,7 @@ Feature Overview
|
||||||
- Focus on high performance
|
- Focus on high performance
|
||||||
- Highly customizable
|
- Highly customizable
|
||||||
- HTTP/2 full support
|
- HTTP/2 full support
|
||||||
|
- Change the default Router's behavior
|
||||||
- Hot Reload on source code changes
|
- Hot Reload on source code changes
|
||||||
- Compatible with all net/http handlers
|
- Compatible with all net/http handlers
|
||||||
- Automatically install and serve certificates from https://letsencrypt.org
|
- Automatically install and serve certificates from https://letsencrypt.org
|
||||||
|
@ -140,10 +135,12 @@ func main(){
|
||||||
```sh
|
```sh
|
||||||
$ go run hellojson.go
|
$ go run hellojson.go
|
||||||
```
|
```
|
||||||
> TIP #1> $ iris run main.go to enable hot-reload on .go source code changes.
|
> TIP: $ iris run main.go to enable hot-reload on .go source code changes.
|
||||||
|
|
||||||
> TIP #2> iris.Config.IsDevelopment = true to monitor the changes you make in the templates.
|
> TIP: iris.Config.IsDevelopment = true to monitor the changes you make in the templates.
|
||||||
|
|
||||||
|
> TIP: Want to change the default Router's behavior to something else like Gorilla's Mux?
|
||||||
|
Go [there](https://github.com/iris-contrib/examples/tree/master/plugin_gorillamux) to learn how.
|
||||||
|
|
||||||
Open your browser or any other http client at http://localhost:6000/api/user/42.
|
Open your browser or any other http client at http://localhost:6000/api/user/42.
|
||||||
|
|
||||||
|
|
12
iris.go
12
iris.go
|
@ -97,6 +97,13 @@ var (
|
||||||
Config *Configuration
|
Config *Configuration
|
||||||
Logger *log.Logger // if you want colors in your console then you should use this https://github.com/iris-contrib/logger instead.
|
Logger *log.Logger // if you want colors in your console then you should use this https://github.com/iris-contrib/logger instead.
|
||||||
Plugins PluginContainer
|
Plugins PluginContainer
|
||||||
|
// Router field holds the main http.Handler which can be changed.
|
||||||
|
// if you want to get benefit with iris' context make use of:
|
||||||
|
// ctx:= iris.AcquireCtx(http.ResponseWriter, *http.Request) to get the context at the beginning of your handler
|
||||||
|
// iris.ReleaseCtx(ctx) to release/put the context to the pool, at the very end of your custom handler.
|
||||||
|
//
|
||||||
|
// Want to change the default Router's behavior to something else like Gorilla's Mux?
|
||||||
|
// See more: https://github.com/iris-contrib/plugin/tree/master/gorillamux
|
||||||
Router http.Handler
|
Router http.Handler
|
||||||
Websocket *WebsocketServer
|
Websocket *WebsocketServer
|
||||||
// Available is a channel type of bool, fired to true when the server is opened and all plugins ran
|
// Available is a channel type of bool, fired to true when the server is opened and all plugins ran
|
||||||
|
@ -250,10 +257,13 @@ type Framework struct {
|
||||||
srv *http.Server
|
srv *http.Server
|
||||||
Available chan bool
|
Available chan bool
|
||||||
//
|
//
|
||||||
// Router field which can change the default iris' mux behavior
|
// Router field holds the main http.Handler which can be changed.
|
||||||
// if you want to get benefit with iris' context make use of:
|
// if you want to get benefit with iris' context make use of:
|
||||||
// ctx:= iris.AcquireCtx(http.ResponseWriter, *http.Request) to get the context at the beginning of your handler
|
// ctx:= iris.AcquireCtx(http.ResponseWriter, *http.Request) to get the context at the beginning of your handler
|
||||||
// iris.ReleaseCtx(ctx) to release/put the context to the pool, at the very end of your custom handler.
|
// iris.ReleaseCtx(ctx) to release/put the context to the pool, at the very end of your custom handler.
|
||||||
|
//
|
||||||
|
// Want to change the default Router's behavior to something else like Gorilla's Mux?
|
||||||
|
// See more: https://github.com/iris-contrib/plugin/tree/master/gorillamux
|
||||||
Router http.Handler
|
Router http.Handler
|
||||||
|
|
||||||
contextPool sync.Pool
|
contextPool sync.Pool
|
||||||
|
|
Loading…
Reference in New Issue
Block a user