mirror of
https://github.com/owncast/owncast.git
synced 2024-11-26 23:24:29 +03:00
236f25b772
* Add support for ending the inbound stream. Closes #191 * Add a simple success response to API requests * Add viewers over time API * Move controllers to admin directory
15 lines
375 B
Go
15 lines
375 B
Go
package admin
|
|
|
|
import (
|
|
"encoding/json"
|
|
"net/http"
|
|
|
|
"github.com/gabek/owncast/metrics"
|
|
)
|
|
|
|
// GetViewersOverTime will return the number of viewers at points in time
|
|
func GetViewersOverTime(w http.ResponseWriter, r *http.Request) {
|
|
viewersOverTime := metrics.Metrics.Viewers
|
|
w.Header().Set("Content-Type", "application/json")
|
|
json.NewEncoder(w).Encode(viewersOverTime)
|
|
}
|