diff --git a/main.go b/main.go index d95f29e..400066c 100644 --- a/main.go +++ b/main.go @@ -79,6 +79,9 @@ type mmsdService struct { func (mmsd *mmsdService) setupHttpService() { router := mux.NewRouter() + router.HandleFunc("/ping", mmsd.v0Ping) + router.HandleFunc("/version", mmsd.v0Version) + v1 := router.PathPrefix("/v1").Subrouter() v1.HandleFunc("/apps", mmsd.v1Apps).Methods("GET") v1.HandleFunc("/instances{app_id:/.*}", mmsd.v1Instances).Methods("GET") @@ -89,6 +92,14 @@ func (mmsd *mmsdService) setupHttpService() { go http.ListenAndServe(serviceAddr, router) } +func (mmsd *mmsdService) v0Ping(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, "pong\n") +} + +func (mmsd *mmsdService) v0Version(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "mmsd %v\n", appVersion) +} + func (mmsd *mmsdService) v1Apps(w http.ResponseWriter, r *http.Request) { m, err := marathon.NewService(mmsd.MarathonIP, mmsd.MarathonPort)