diff --git a/http/httphi/example_test.go b/http/httphi/example_test.go index 24e92d8..07b6bf8 100644 --- a/http/httphi/example_test.go +++ b/http/httphi/example_test.go @@ -60,6 +60,11 @@ func ExampleMuxSlice_query_forms_multipart() { var mux httphi.MuxSlice + mux.Handle("/users/{id}", func(ex *httphi.Exchange) { + userID := ex.PathValue("id") + fmt.Printf("someone requested data for user %s", userID) + }) + mux.Handle("/query", func(ex *httphi.Exchange) { // query parameter in URL. const decodeQuery = true