mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-10 14:19:09 -07:00
serve stats via /check
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user