Skip to content

Commit

Permalink
doc(readme): add additional middleware doc. (gin-gonic#1056)
Browse files Browse the repository at this point in the history
  • Loading branch information
easonlin404 authored and Tony Yip committed Feb 20, 2018
1 parent fff0273 commit 263b132
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ r := gin.New()
instead of

```go
// Default With the Logger and Recovery middleware already attached
r := gin.Default()
```

Expand All @@ -327,7 +328,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.
Expand Down

0 comments on commit 263b132

Please sign in to comment.