doc(readme): add additional middleware doc. (#1056)

This commit is contained in:
Eason Lin 2017-08-17 12:18:50 +08:00 committed by Bo-Yi Wu
parent a8fa424ae5
commit 3856206bd0

View File

@ -369,6 +369,7 @@ r := gin.New()
instead of
```go
// Default With the Logger and Recovery middleware already attached
r := gin.Default()
```
@ -380,7 +381,10 @@ func main() {
r := gin.New()
// Global middleware
// Logger middleware will write the logs to gin.DefaultWriter even you set with GIN_MODE=release. By default gin.DefaultWriter = os.Stdout
r.Use(gin.Logger())
// Recovery middleware recovers from any panics and writes a 500 if there was one.
r.Use(gin.Recovery())
// Per route middleware, you can add as many as you desire.