log.Println("✅ Comment query API registered (20 req/min rate limit)")
log.Println(" - GET /xrpc/social.coves.community.comment.getComments")
460
-
r.Get("/health", func(w http.ResponseWriter, r *http.Request) {
460
+
// Health check endpoints
461
+
healthHandler := func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
if _, err := w.Write([]byte("OK")); err != nil {
log.Printf("Failed to write health check response: %v", err)
467
+
r.Get("/health", healthHandler)
468
+
r.Get("/xrpc/_health", healthHandler)
467
-
port := os.Getenv("APPVIEW_PORT")
470
+
// Check PORT first (docker-compose), then APPVIEW_PORT (legacy)
471
+
port := os.Getenv("PORT")
473
+
port = os.Getenv("APPVIEW_PORT")
469
-
port = "8081" // Match .env.dev default
fmt.Printf("Coves AppView starting on port %s\n", port)