diff --git a/README.md b/README.md index c16ba499..d6cf0af6 100644 --- a/README.md +++ b/README.md @@ -39,19 +39,13 @@ If you're coming from Node.js world, this i

-When humor goes, there goes civilization ------------ -

- -

- -What you say about Iris +What The Community Says ----------- [![What people say](https://github.com/iris-contrib/website/raw/gh-pages/assets/gif_link_to_yt2.gif)](https://www.youtube.com/watch?v=jGx0LkuUs4A) [![What people say](https://github.com/iris-contrib/website/raw/gh-pages/assets/gif_link_to_yt.gif)](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 @@ -60,6 +54,7 @@ Feature Overview - Focus on high performance - Highly customizable - HTTP/2 full support +- Change the default Router's behavior - Hot Reload on source code changes - Compatible with all net/http handlers - Automatically install and serve certificates from https://letsencrypt.org @@ -140,10 +135,12 @@ func main(){ ```sh $ 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. diff --git a/iris.go b/iris.go index ae634e1d..fc0eb4b3 100644 --- a/iris.go +++ b/iris.go @@ -97,6 +97,13 @@ var ( Config *Configuration Logger *log.Logger // if you want colors in your console then you should use this https://github.com/iris-contrib/logger instead. 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 Websocket *WebsocketServer // Available is a channel type of bool, fired to true when the server is opened and all plugins ran @@ -108,7 +115,7 @@ var ( ) // ResetDefault resets the iris.Default which is the instance which is used on the default iris station for -// iris.Get(all api functions) +// iris.Get(all api functions) // iris.Config // iris.Logger // iris.Plugins @@ -250,10 +257,13 @@ type Framework struct { srv *http.Server 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: // 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 contextPool sync.Pool