diff --git a/cmd/orchestra/main.go b/cmd/orchestra/main.go index ef0becd..3bc1f54 100644 --- a/cmd/orchestra/main.go +++ b/cmd/orchestra/main.go @@ -362,6 +362,14 @@ func main() { w.WriteHeader(http.StatusCreated) json.NewEncoder(w).Encode(worker) }) + mux.HandleFunc("/v1/federation/events", func(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet { + http.Error(w, "method not allowed", 405) + return + } + cursor, _ := strconv.ParseUint(r.URL.Query().Get("since"), 10, 64) + json.NewEncoder(w).Encode(s.Events(cursor)) + }) mux.HandleFunc("/v1/federation/workers/", func(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost || !strings.HasSuffix(r.URL.Path, "/heartbeat") { http.Error(w, "not found", 404)