Adds pretty print to info

This commit is contained in:
Alexey Khit
2022-09-16 17:35:41 +03:00
parent 105331d50f
commit 8f43ad2a35
2 changed files with 4 additions and 16 deletions

View File

@@ -102,13 +102,9 @@ func streamsHandler(w http.ResponseWriter, r *http.Request) {
v = streams.All()
}
data, err := json.Marshal(v)
if err != nil {
log.Error().Err(err).Msg("[api.streams] marshal")
return
}
_, _ = w.Write(data)
e := json.NewEncoder(w)
e.SetIndent("", " ")
_ = e.Encode(v)
}
func apiWS(w http.ResponseWriter, r *http.Request) {