package api import ( "encoding/json" "net/http" "smm2_gameserver/orm" ) func initStats() { Secure("/api/stats", func(w http.ResponseWriter, r *http.Request, user orm.User) { stats, err := dataView.ServerStats() if err != nil { reportError(w, r, err) return } json.NewEncoder(w).Encode(stats) }).Methods("GET") }