Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Add GetAdminStatus endpoint that is compatible with admin auth

Gabe Kangasb0913ab5de09
diff --git a/controllers/status.go b/controllers/status.go
index 14aa886243..93f81eb47f 100644
--- a/controllers/status.go
+++ b/controllers/status.go
@@ -17,3 +17,11 @@ func GetStatus(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(status)
}
+
+//GetStatus gets the status of the server
+func GetAdminStatus(w http.ResponseWriter, r *http.Request) {
+ status := core.GetStatus()
+ w.Header().Set("Content-Type", "application/json")
+
+ json.NewEncoder(w).Encode(status)
+}
diff --git a/router/router.go b/router/router.go
index b199a80c35..25b5623bab 100644
--- a/router/router.go
+++ b/router/router.go
@@ -48,6 +48,9 @@ func Start() error {
// Authenticated admin requests
+ // status of the system
+ http.HandleFunc("/api/admin/status", middleware.RequireAdminAuth(controllers.GetAdminStatus))
+
// Current inbound broadcaster
http.HandleFunc("/api/admin/broadcaster", middleware.RequireAdminAuth(admin.GetInboundBroadasterDetails))