add openapi docu

This commit is contained in:
Cubicroot 2021-10-01 18:19:50 +02:00
parent afa4a9f866
commit 54d3cef46a
6 changed files with 109 additions and 22 deletions

View file

@ -11,7 +11,13 @@ type HealthHandler struct {
DB Database
}
// Health returns the health status of the server.
// Health godoc
// @Summary Health of the application
// @Accept json,mpfd
// @Produce json
// @Success 200 ""
// @Failure 500 ""
// @Router /health [get]
func (h *HealthHandler) Health(ctx *gin.Context) {
if err := h.DB.Health(); err != nil {
ctx.AbortWithError(http.StatusInternalServerError, err)