From 02740548def366b2917d6e57fb9bde84d9f27e64 Mon Sep 17 00:00:00 2001 From: trafficlunar Date: Sun, 20 Jul 2025 16:28:20 +0100 Subject: [PATCH] feat: show commit hash in index route only works on coolify or if you specify the SOURCE_COMMIT environment variable manually --- internal/server/router.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/server/router.go b/internal/server/router.go index 45bae75..2d5a66d 100644 --- a/internal/server/router.go +++ b/internal/server/router.go @@ -55,8 +55,9 @@ func NewRouter() { r.Get("/", func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(map[string]string{ - "name": "trafficlunar's api", - "url": "https://github.com/trafficlunar/api", + "name": "trafficlunar's api", + "url": "https://github.com/trafficlunar/api", + "commit": os.Getenv("SOURCE_COMMIT")[:7], // shorten to 7 characters }) }) r.Get("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {