Skip to content

Commit

Permalink
📝update handler example in timeout (#1328)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Garg authored May 10, 2021
1 parent e1089fc commit e7d5759
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions middleware/timeout/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ import (

After you initiate your Fiber app, you can use the following possibilities:
```go
handler := func(ctx *fiber.Ctx) {
ctx.Send("Hello, World 👋!")
handler := func(ctx *fiber.Ctx) error {
err := ctx.SendString("Hello, World 👋!")
if err != nil {
return err
}
return nil
}

app.Get("/foo", timeout.New(handler, 5 * time.Second))
```
```

0 comments on commit e7d5759

Please sign in to comment.