Add GetAdminStatus endpoint that is compatible with admin auth
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user