Add the RegisterWith method to HTTPServer to register all three
health paths with a mux. The mux needs to implement the health.Router
interface which http.ServeMuxdoes . chi also does, for example.
Unfortunately gorilla/mux does not (it has a return value).
Reimplement ServeHTTP in with RegisterWith on a http.ServeMux to
remove the code duplication that would have otherwise existed.
Adjust the TestHTTPMethodNotAllowed test as the order of checking
paths and methods have changed.
Also rename TestRegisterWith to TestGRPCRegisterWith since there is
now another RegisterWith.
Add the
RegisterWith
method toHTTPServer
to register all three health paths with a mux. The mux needs to implement thehealth.Router
interface whichhttp.ServeMux
does .chi
also does, for example. Unfortunatelygorilla/mux
does not (it has a return value).Reimplement
ServeHTTP
in withRegisterWith
on ahttp.ServeMux
to remove the code duplication that would have otherwise existed.Adjust the
TestHTTPMethodNotAllowed
test as the order of checking paths and methods have changed.Also rename
TestRegisterWith
toTestGRPCRegisterWith
since there is now anotherRegisterWith
.