dashboard: add graph score

This commit is contained in:
nemunaire 2020-01-30 04:17:53 +01:00
parent d66de6fb3c
commit b9fa5accff
5 changed files with 216 additions and 8 deletions

View file

@ -93,12 +93,11 @@ func init() {
http.ServeFile(w, r, path.Join(TeamsDir, "public", "my.json"))
}
})
api.Router().GET("/stats.json", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
w.Header().Set("Cache-Control", "no-cache")
api.Router().GET("/api/teams/:tid/score-grid.json", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
if forwarder != nil {
fwd_request(w, r, *forwarder)
} else {
http.ServeFile(w, r, path.Join(TeamsDir, "public", "stats.json"))
fwd_request(w, r, "http://127.0.0.1:8081/")
}
})
api.Router().GET("/api/teams/:tid/stats.json", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {