feat: show commit hash in index route
only works on coolify or if you specify the SOURCE_COMMIT environment variable manually
This commit is contained in:
parent
af790e5765
commit
02740548de
1 changed files with 3 additions and 2 deletions
|
|
@ -57,6 +57,7 @@ func NewRouter() {
|
||||||
json.NewEncoder(w).Encode(map[string]string{
|
json.NewEncoder(w).Encode(map[string]string{
|
||||||
"name": "trafficlunar's api",
|
"name": "trafficlunar's api",
|
||||||
"url": "https://github.com/trafficlunar/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) {
|
r.Get("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue