This commit is contained in:
Alex Shevchuk
2025-08-18 17:12:04 +03:00
commit d84487d238
157 changed files with 160686 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package http_router
import (
"encoding/json"
"net/http"
)
func (h *handler) getBuildInfoHandler(w http.ResponseWriter, _ *http.Request) {
response := struct {
Version string `json:"version"`
Commit string `json:"commit"`
Date string `json:"date"`
}{
Version: h.buildConfig.Version,
Commit: h.buildConfig.Commit,
Date: h.buildConfig.Date,
}
responseJSON, err := json.Marshal(response)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write(responseJSON)
}