Add GetAdminStatus endpoint that is compatible with admin auth
This commit is contained in:
parent
8ed21d303f
commit
903c977b13
@ -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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user