From 655eb491c490a5fe8fa7f447aab54254b54f74c7 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Mon, 18 Nov 2024 16:59:44 -0800 Subject: [PATCH] add root path handler for rainbow --- splitter/splitter.go | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/splitter/splitter.go b/splitter/splitter.go index e167b7757..b592edd8c 100644 --- a/splitter/splitter.go +++ b/splitter/splitter.go @@ -196,10 +196,11 @@ func (s *Splitter) StartWithListener(listen net.Listener) error { } } - // TODO: this API is temporary until we formalize what we want here - e.GET("/xrpc/com.atproto.sync.subscribeRepos", s.EventsHandler) + e.GET("/xrpc/_health", s.HandleHealthCheck) + e.GET("/_health", s.HandleHealthCheck) + e.GET("/", s.HandleHomeMessage) // In order to support booting on random ports in tests, we need to tell the // Echo instance it's already got a port, and then use its StartServer @@ -218,6 +219,21 @@ func (s *Splitter) HandleHealthCheck(c echo.Context) error { return c.JSON(200, HealthStatus{Status: "ok"}) } +var homeMessage string = ` + _ _ + _ _ __ _(_)_ _ | |__ _____ __ __ +| '_/ _' | | ' \| '_ \/ _ \ V V / +|_| \__,_|_|_||_|_.__/\___/\_/\_/ + +This is an atproto [https://atproto.com] firehose fanout service, running the 'rainbow' codebase [https://github.com/bluesky-social/indigo] + +The firehose WebSocket path is at: /xrpc/com.atproto.sync.subscribeRepos +` + +func (s *Splitter) HandleHomeMessage(c echo.Context) error { + return c.String(http.StatusOK, homeMessage) +} + func (s *Splitter) EventsHandler(c echo.Context) error { var since *int64 if sinceVal := c.QueryParam("cursor"); sinceVal != "" {