mirror of
https://github.com/owncast/owncast.git
synced 2024-11-25 06:12:23 +03:00
Consolidate the ping and status request APIs
This commit is contained in:
parent
ba4a4b0b13
commit
b96cd2e93e
3 changed files with 12 additions and 24 deletions
|
@ -1,13 +0,0 @@
|
|||
package controllers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/owncast/owncast/core"
|
||||
"github.com/owncast/owncast/utils"
|
||||
)
|
||||
|
||||
func Ping(w http.ResponseWriter, r *http.Request) {
|
||||
id := utils.GenerateClientIDFromRequest(r)
|
||||
core.SetViewerIdActive(id)
|
||||
}
|
|
@ -27,6 +27,10 @@ func GetStatus(w http.ResponseWriter, r *http.Request) {
|
|||
if err := json.NewEncoder(w).Encode(response); err != nil {
|
||||
InternalErrorHandler(w, err)
|
||||
}
|
||||
|
||||
// Mark the user who requested this status as an active viewer
|
||||
id := utils.GenerateClientIDFromRequest(r)
|
||||
core.SetViewerIdActive(id)
|
||||
}
|
||||
|
||||
type webStatusResponse struct {
|
||||
|
|
|
@ -62,9 +62,6 @@ func Start() error {
|
|||
// return the list of video variants available
|
||||
http.HandleFunc("/api/video/variants", controllers.GetVideoStreamOutputVariants)
|
||||
|
||||
// tell the backend you're an active viewer
|
||||
http.HandleFunc("/api/ping", controllers.Ping)
|
||||
|
||||
// Authenticated admin requests
|
||||
|
||||
// Current inbound broadcaster
|
||||
|
|
Loading…
Reference in a new issue