serve stats via /check

This commit is contained in:
Jimmy Zelinskie
2014-07-22 01:12:41 -04:00
parent e17c984ec8
commit fa191de6d3
2 changed files with 24 additions and 21 deletions

View File

@@ -20,7 +20,10 @@ import (
const jsonContentType = "application/json; charset=UTF-8"
func (s *Server) check(w http.ResponseWriter, r *http.Request, p httprouter.Params) (int, error) {
_, err := w.Write([]byte("An easter egg goes here."))
w.Header().Set("Content-Type", jsonContentType)
e := json.NewEncoder(w)
err := e.Encode(stats.DefaultStats)
if err != nil {
return http.StatusInternalServerError, err
}