diff --git a/internal/http/dj_handlers.go b/internal/http/dj_handlers.go index 6def03b..ea8a743 100644 --- a/internal/http/dj_handlers.go +++ b/internal/http/dj_handlers.go @@ -23,8 +23,8 @@ func NewDJHandlers(l *radio.ListenerCounter, p *radio.Playlist, slLen int) *DJHa } func (dj *DJHandlers) ListenersGet(w http.ResponseWriter, _ *http.Request) { - w.Header().Add("Content-Type", "text/plain") - fmt.Fprint(w, dj.listeners.Current(), dj.listeners.Peak()) + w.Header().Add("Content-Type", "application/json") + json.NewEncoder(w).Encode(dj.listeners) } func (dj *DJHandlers) ListenersInc(w http.ResponseWriter, _ *http.Request) {