Low-latency AT Protocol interaction indexer.
20

Configure Feed

Select the types of activity you want to include in your feed.

add /health endpoint

Aly Raffauf (Jul 3, 2026, 9:40 PM EDT) 2ae971be 6205570e

+20 -1
+2 -1
README.md
··· 175 175 - [ ] Account deactivation handling 176 176 - [x] Graceful shutdown and Firehose reconnect 177 177 - [x] CI + Dockerfile 178 + - [x] Add health endpoint 178 179 179 180 **Medium term** 180 181 181 182 - [ ] Robust automatic backfill with checkpoint/resume (survive restarts mid-backfill) 182 183 - [ ] Exponential backoff for getRepo requests 183 184 - [ ] Backfill progress reporting 184 - - [ ] Metrics and health endpoints 185 + - [ ] Prometheus metrics endpoint 185 186 186 187 **Longer term** 187 188
+11
internal/api/health.go
··· 1 + package api 2 + 3 + import "net/http" 4 + 5 + func (s *Server) Health(w http.ResponseWriter, r *http.Request) { 6 + if err := s.Store.Ping(r.Context()); err != nil { 7 + http.Error(w, "unhealthy", http.StatusServiceUnavailable) 8 + return 9 + } 10 + w.WriteHeader(http.StatusOK) 11 + }
+2
internal/api/server.go
··· 12 12 13 13 func (s *Server) Run(addr string) error { 14 14 mux := http.NewServeMux() 15 + mux.HandleFunc("GET /health", s.Health) 16 + 15 17 mux.HandleFunc("GET /xrpc/blue.microcosm.links.getBacklinksCount", s.GetBacklinksCount) 16 18 mux.HandleFunc("GET /xrpc/blue.microcosm.links.getBacklinkDids", s.GetBacklinkDids) 17 19 mux.HandleFunc("GET /xrpc/blue.microcosm.links.getBacklinks", s.GetBacklinks)
+5
internal/store/store.go
··· 1 1 package store 2 2 3 3 import ( 4 + "context" 4 5 "database/sql" 5 6 "fmt" 6 7 ··· 60 61 61 62 return &Store{writeDB: writeDB, readDB: readDB}, nil 62 63 } 64 + 65 + func (s *Store) Ping(ctx context.Context) error { 66 + return s.readDB.PingContext(ctx) 67 + }