Skip to content

Commit 5711152

Browse files
author
pingliu
committed
fix example error
1 parent f6cdc40 commit 5711152

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

_examples/cas-chi.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ func main() {
2626
root := chi.NewRouter()
2727
root.Use(client.Handler)
2828

29+
server := &http.Server{
30+
Addr: ":9999",
31+
Handler: client.Handle(root),
32+
}
33+
2934
root.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
3035
w.Header().Add("Content-Type", "text/html")
3136

@@ -52,7 +57,7 @@ func main() {
5257
html.WriteTo(w)
5358
})
5459

55-
if err := http.ListenAndServe(":9999", root); err != nil {
60+
if err := server.ListenAndServe(); err != nil {
5661
log.Fatal(err)
5762
}
5863
}

0 commit comments

Comments
 (0)