Skip to content

Commit

Permalink
Add example of server timeout config to README
Browse files Browse the repository at this point in the history
  • Loading branch information
martinrue committed Mar 30, 2024
1 parent 1565fe3 commit 7444728
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ func EchoHandler(r *cadet.Request, em *EchoMaker) cadet.Response {
}

func main() {
server := cadet.NewServer(&cadet.Config{Bind: ":1234"}, &EchoMaker{})
server := cadet.NewServer(&cadet.Config{
Bind: ":1234",
Server: &cadet.ServerConfig{
ReadTimeout: 25 * time.Second,
WriteTimeout: 0,
},
}, &EchoMaker{})

err := server.Commands(
"echo", EchoHandler,
Expand Down

0 comments on commit 7444728

Please sign in to comment.