diff options
author | Emile <hanemile@protonmail.com> | 2019-10-09 18:32:29 +0200 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-10-09 18:32:29 +0200 |
commit | de78273f080634b57cc0e0e7c3e05e3ff03d0478 (patch) | |
tree | 3597a0160b615499797a0d0e725b2cfe35f58315 /src/http.go | |
parent | b88e0e41d59c26dd281b41bdd0c754f54e90e3e2 (diff) |
metrics exposed on /
Diffstat (limited to 'src/http.go')
-rw-r--r-- | src/http.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/http.go b/src/http.go index 0095663..0add89e 100644 --- a/src/http.go +++ b/src/http.go @@ -21,7 +21,11 @@ func setupHTTPServer() http.Server { // indexHandler handles the "/" endpoint func indexHandler(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, "This is the index Handler speaking! Prepare to HACK THE PLANET!") + if userFlags == nil { + userFlags = make(map[string]int) + } - // insert scoreboard here + for _, user := range users { + fmt.Fprintf(w, "challengesSolves{name=%s} %d\n", user, userFlags[user]) + } } |