Skip to content

Commit

Permalink
fix(mux): allow api mux override
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed Jan 26, 2021
1 parent 1a0ef6f commit eccdf9b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ func HealthCheckHandler(w http.ResponseWriter, r *http.Request) {
func NewServerRoutes(s Server) *http.ServeMux {
cfg := s.Config()

m := http.NewServeMux()
m := s.Mux
if m == nil {
m = http.NewServeMux()
}

m.Handle("/", s.NoLogMiddleware(s.HomeHandler))
m.Handle("/health", s.NoLogMiddleware(HealthCheckHandler))
Expand Down

0 comments on commit eccdf9b

Please sign in to comment.