mirror of
https://github.com/kataras/iris.git
synced 2025-03-13 21:36: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>
|
||||
|
||||
When humor goes, there goes civilization
|
||||
-----------
|
||||
|
||||
<p align="center">
|
||||
<img src="https://github.com/iris-contrib/website/raw/gh-pages/assets/comics/comic1.png" />
|
||||
</p>
|
||||
|
||||
What you say about Iris
|
||||
What The Community Says
|
||||
-----------
|
||||
[](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
|
||||
|
@ -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.
|
||||
|
||||
|
|
14
iris.go
14
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user