|
|
|
@ -21,6 +21,7 @@ func handleReadStatus(statusFunc func() spaceapi.SpaceStatus) http.Handler {
|
|
|
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
status := statusFunc() |
|
|
|
|
|
|
|
|
|
w.Header().Set("Content-Type", "application/json; charset=utf-8") |
|
|
|
|
if err := json.NewEncoder(w).Encode(status); err != nil { |
|
|
|
|
http.Error(w, fmt.Sprintf("Error encoding JSON: %s", err), http.StatusInternalServerError) |
|
|
|
|
} |
|
|
|
|