don't use default mux

This commit is contained in:
Joel Wetzell
2025-12-26 11:01:30 -06:00
parent cc37559bde
commit 0ed4d6669f

View File

@@ -54,7 +54,7 @@ func (hs *HTTPServer) Type() string {
return hs.config.Type return hs.config.Type
} }
func (hs *HTTPServer) HandleDefault(w http.ResponseWriter, r *http.Request) { func (hs *HTTPServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
response := ResponseData{ response := ResponseData{
@@ -82,11 +82,9 @@ func (hs *HTTPServer) HandleDefault(w http.ResponseWriter, r *http.Request) {
} }
func (hs *HTTPServer) Run() error { func (hs *HTTPServer) Run() error {
http.HandleFunc("/", hs.HandleDefault)
httpServer := &http.Server{ httpServer := &http.Server{
Addr: fmt.Sprintf(":%d", hs.Port), Addr: fmt.Sprintf(":%d", hs.Port),
Handler: http.DefaultServeMux, Handler: hs,
} }
go func() { go func() {