diff --git a/server/handlers.go b/server/handlers.go index 7514de56ff..22116079e6 100644 --- a/server/handlers.go +++ b/server/handlers.go @@ -29,6 +29,12 @@ import ( const MainnetChainId = 1 const RinkebyChainId = 4 +func (s *LivepeerServer) healthzHandler() http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + respondOk(w, nil) + }) +} + // Status func (s *LivepeerServer) statusHandler() http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/server/mediaserver.go b/server/mediaserver.go index 168686525c..e24bf1edbe 100644 --- a/server/mediaserver.go +++ b/server/mediaserver.go @@ -199,6 +199,9 @@ func (s *LivepeerServer) StartMediaServer(ctx context.Context, httpAddr string) // Store ctx to later use as cancel signal for watchdog goroutine s.context = ctx + // health endpoint + s.HTTPMux.Handle("/healthz", s.healthzHandler()) + //LPMS handlers for handling RTMP video s.LPMS.HandleRTMPPublish(createRTMPStreamIDHandler(ctx, s, nil), gotRTMPStreamHandler(s), endRTMPStreamHandler(s)) s.LPMS.HandleRTMPPlay(getRTMPStreamHandler(s))