Skip to content

Commit

Permalink
docs: fix id in path
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr authored Nov 28, 2024
1 parent 24a9bb9 commit 42b8a22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ type RoutesReceiver interface {
}

func routes(mux *http.ServeMux, receiver RoutesReceiver) {
mux.HandleFunc("GET /articles/:id", func(response http.ResponseWriter, request *http.Request) {
mux.HandleFunc("GET /articles/{id}", func(response http.ResponseWriter, request *http.Request) {
ctx := request.Context()
id := request.PathValue("id")
data := receiver.ReadArticle(ctx, id)
execute(response, request, true, "GET /articles/:id ReadArticle(ctx, id)", http.StatusOK, data)
execute(response, request, true, "GET /articles/{id} ReadArticle(ctx, id)", http.StatusOK, data)
})
}

Expand Down

0 comments on commit 42b8a22

Please sign in to comment.