added prometheus route

This commit is contained in:
sm
2016-09-25 15:24:14 -07:00
parent a0ca983b45
commit abe0e155a9
+2
View File
@@ -11,6 +11,7 @@ import (
"github.com/elazarl/go-bindata-assetfs"
"github.com/gorilla/sessions"
"github.com/prometheus/client_golang/prometheus"
)
//go:generate go-bindata -o static.go static/
@@ -24,6 +25,7 @@ var store = sessions.NewCookieStore([]byte(os.Getenv("MMG_SECRET_KEY")))
func main() {
rand.Seed(time.Now().UTC().UnixNano())
flag.Parse()
http.Handle("/metrics", prometheus.Handler())
http.HandleFunc("/api/v0/addsub/problem/", addsub)
http.HandleFunc("/api/v0/mul/problem/", mul)
http.HandleFunc("/api/v0/attempt/", attempt)