Placeholder for health check endpoint

This commit is contained in:
Matthew Dillon 2015-01-09 11:10:43 -09:00
parent e649352d52
commit cbb45c3fd7
4 changed files with 11 additions and 4 deletions

View file

@ -115,7 +115,3 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
writeJSON(w, Error{hErr})
}
}
func restrictedHandler(w http.ResponseWriter, r *http.Request) error {
return writeJSON(w, Message{"great success"})
}

View file

@ -74,6 +74,8 @@ func Handler() *mux.Router {
m.Get(router.SubrouterListStrains).Handler(authHandler(serveSubrouterStrainsList))
m.Get(router.SubrouterListMeasurements).Handler(authHandler(serveSubrouterMeasurementsList))
m.Get(router.Health).Handler(handler(healthHandler))
return m
}
@ -86,3 +88,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
writeJSON(w, Error{err})
}
}
func healthHandler(w http.ResponseWriter, r *http.Request) error {
return writeJSON(w, Message{"great success"})
}

View file

@ -73,5 +73,8 @@ func API() *mux.Router {
s.Path("/strains").Methods("GET").Name(SubrouterListStrains)
s.Path("/measurements").Methods("GET").Name(SubrouterListMeasurements)
// Misc
m.Path("/health").Methods("GET").Name(Health)
return m
}

View file

@ -57,4 +57,6 @@ const (
SubrouterListSpecies = "subrouter_species:list"
SubrouterListStrains = "subrouter_strains:list"
SubrouterListMeasurements = "subrouter_measurements:list"
Health = "health:get"
)