Add /api/v1/info for build info output.
This commit is contained in:
parent
095e24a2b0
commit
08d5f36c36
@ -152,6 +152,25 @@ func (h *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
_, _ = w.Write(appsList)
|
_, _ = w.Write(appsList)
|
||||||
|
|
||||||
|
return
|
||||||
|
case "info":
|
||||||
|
infoData := struct {
|
||||||
|
Branch string
|
||||||
|
Build string
|
||||||
|
CommitHash string
|
||||||
|
Version string
|
||||||
|
}{
|
||||||
|
Branch: common.Branch,
|
||||||
|
Build: common.Build,
|
||||||
|
CommitHash: common.CommitHash,
|
||||||
|
Version: common.Version,
|
||||||
|
}
|
||||||
|
|
||||||
|
infoBytes, _ := json.Marshal(infoData)
|
||||||
|
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
_, _ = w.Write(infoBytes)
|
||||||
|
|
||||||
return
|
return
|
||||||
case "metrics":
|
case "metrics":
|
||||||
handler, found := h.handlers[rInfo.Application]
|
handler, found := h.handlers[rInfo.Application]
|
||||||
|
Loading…
Reference in New Issue
Block a user