kojiapi: add /status route

It works the same way as in the worker API. It's very handy when we just want
to test whether the API is up and running.
This commit is contained in:
Ondřej Budai 2020-09-22 14:52:23 +02:00 committed by Tom Gundersen
parent 28aff2259a
commit c6b5dd8977
3 changed files with 47 additions and 0 deletions

View file

@ -247,6 +247,13 @@ func (h *apiHandlers) GetComposeId(ctx echo.Context, idstr string) error {
return ctx.JSON(http.StatusOK, response)
}
// GetStatus handles a /status GET request
func (h *apiHandlers) GetStatus(ctx echo.Context) error {
return ctx.JSON(http.StatusOK, &api.Status{
Status: "OK",
})
}
// A simple echo.Binder(), which only accepts application/json, but is more
// strict than echo's DefaultBinder. It does not handle binding query
// parameters either.