diff --git a/apihandlers.go b/apihandlers.go index 9a0e675..32c66df 100644 --- a/apihandlers.go +++ b/apihandlers.go @@ -3,6 +3,7 @@ package feta import "time" import "net/http" import "encoding/json" +import "runtime" import "github.com/gin-gonic/gin" @@ -38,11 +39,17 @@ func (a *FetaAPIServer) getIndexHandler() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { index := &gin.H{ - "page": "index", "instances": a.instances(), - "status": "ok", - "now": time.Now().UTC().Format(time.RFC3339), - "uptime": a.feta.Uptime().String(), + "server": &gin.H{ + "now": time.Now().UTC().Format(time.RFC3339), + "uptime": a.feta.Uptime().String(), + "goroutines": runtime.NumGoroutine(), + "goversion": runtime.Version(), + "version": a.feta.version, + "buildtime": a.feta.buildtime, + "buildarch": a.feta.buildarch, + "builduser": a.feta.builduser, + }, } json, err := json.Marshal(index)