Placeholder for health check endpoint
This commit is contained in:
parent
e649352d52
commit
cbb45c3fd7
4 changed files with 11 additions and 4 deletions
|
@ -115,7 +115,3 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
writeJSON(w, Error{hErr})
|
writeJSON(w, Error{hErr})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func restrictedHandler(w http.ResponseWriter, r *http.Request) error {
|
|
||||||
return writeJSON(w, Message{"great success"})
|
|
||||||
}
|
|
||||||
|
|
|
@ -74,6 +74,8 @@ func Handler() *mux.Router {
|
||||||
m.Get(router.SubrouterListStrains).Handler(authHandler(serveSubrouterStrainsList))
|
m.Get(router.SubrouterListStrains).Handler(authHandler(serveSubrouterStrainsList))
|
||||||
m.Get(router.SubrouterListMeasurements).Handler(authHandler(serveSubrouterMeasurementsList))
|
m.Get(router.SubrouterListMeasurements).Handler(authHandler(serveSubrouterMeasurementsList))
|
||||||
|
|
||||||
|
m.Get(router.Health).Handler(handler(healthHandler))
|
||||||
|
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,3 +88,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
writeJSON(w, Error{err})
|
writeJSON(w, Error{err})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func healthHandler(w http.ResponseWriter, r *http.Request) error {
|
||||||
|
return writeJSON(w, Message{"great success"})
|
||||||
|
}
|
||||||
|
|
|
@ -73,5 +73,8 @@ func API() *mux.Router {
|
||||||
s.Path("/strains").Methods("GET").Name(SubrouterListStrains)
|
s.Path("/strains").Methods("GET").Name(SubrouterListStrains)
|
||||||
s.Path("/measurements").Methods("GET").Name(SubrouterListMeasurements)
|
s.Path("/measurements").Methods("GET").Name(SubrouterListMeasurements)
|
||||||
|
|
||||||
|
// Misc
|
||||||
|
m.Path("/health").Methods("GET").Name(Health)
|
||||||
|
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,4 +57,6 @@ const (
|
||||||
SubrouterListSpecies = "subrouter_species:list"
|
SubrouterListSpecies = "subrouter_species:list"
|
||||||
SubrouterListStrains = "subrouter_strains:list"
|
SubrouterListStrains = "subrouter_strains:list"
|
||||||
SubrouterListMeasurements = "subrouter_measurements:list"
|
SubrouterListMeasurements = "subrouter_measurements:list"
|
||||||
|
|
||||||
|
Health = "health:get"
|
||||||
)
|
)
|
||||||
|
|
Reference in a new issue