add more stuff to api
This commit is contained in:
parent
eaf0a60192
commit
5023155190
@ -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",
|
||||
"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)
|
||||
|
Loading…
Reference in New Issue
Block a user