From d8939199f129ccb1abcf0150012bc23209facf12 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sun, 22 Mar 2026 09:13:51 +0000 Subject: feat: color logo based on build version hash Adds GET /api/version endpoint and uses the first 6 hex chars of the commit hash to derive an HSL hue for the header h1 logo color. Co-Authored-By: Claude Sonnet 4.6 --- internal/api/server.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal') diff --git a/internal/api/server.go b/internal/api/server.go index 9e3cde4..bb23f46 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -15,6 +15,7 @@ import ( "github.com/thepeterstone/claudomator/internal/notify" "github.com/thepeterstone/claudomator/internal/storage" "github.com/thepeterstone/claudomator/internal/task" + "github.com/thepeterstone/claudomator/internal/version" webui "github.com/thepeterstone/claudomator/web" "github.com/google/uuid" ) @@ -147,6 +148,7 @@ func (s *Server) routes() { s.mux.HandleFunc("POST /api/stories/{id}/tasks", s.handleAddTaskToStory) s.mux.HandleFunc("PUT /api/stories/{id}/status", s.handleUpdateStoryStatus) s.mux.HandleFunc("GET /api/health", s.handleHealth) + s.mux.HandleFunc("GET /api/version", s.handleVersion) s.mux.HandleFunc("POST /api/webhooks/github", s.handleGitHubWebhook) s.mux.HandleFunc("GET /api/push/vapid-key", s.handleGetVAPIDKey) s.mux.HandleFunc("GET /api/push/sw.js", s.handleServiceWorker) @@ -424,6 +426,10 @@ func (s *Server) handleHealth(w http.ResponseWriter, r *http.Request) { }) } +func (s *Server) handleVersion(w http.ResponseWriter, r *http.Request) { + writeJSON(w, http.StatusOK, map[string]string{"version": version.Version()}) +} + func (s *Server) handleCreateTask(w http.ResponseWriter, r *http.Request) { var input struct { Name string `json:"name"` -- cgit v1.2.3