Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Oct 18, 2021
1 parent 853a90a commit 4026a11
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions request.go
Expand Up @@ -21,6 +21,7 @@ func contextWithParams(ctx context.Context, params Params) context.Context {

//------------------------------------------------------------------------------

// HTTPHandler converts http.Handler from the stdlib to bunrouter.HandlerFunc.
func HTTPHandler(handler http.Handler) HandlerFunc {
return func(w http.ResponseWriter, req Request) error {
ctx := contextWithParams(req.Context(), req.params)
Expand All @@ -29,6 +30,7 @@ func HTTPHandler(handler http.Handler) HandlerFunc {
}
}

// HTTPHandlerFunc converts http.HandlerFunc from the stdlib to bunrouter.HandlerFunc.
func HTTPHandlerFunc(handler http.HandlerFunc) HandlerFunc {
return HTTPHandler(http.HandlerFunc(handler))
}
Expand Down

0 comments on commit 4026a11

Please sign in to comment.