mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
don't use default mux
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user