Files
webhook-everything/backend/cmd/server/health.go
Samuel Pua 53829a2788
All checks were successful
Webhook-Everything/Webhook-Everything/pipeline/head This commit looks good
Feat(Initial): Initial Go codebase
2022-05-29 00:06:52 +08:00

32 lines
654 B
Go

package main
import (
"net/http"
"github.com/go-chi/render"
)
type HealthStatus struct {
Status string `json:"status"`
}
func (*HealthStatus) Render(w http.ResponseWriter, r *http.Request) error {
// Pre-processing before a response is marshalled and sent across the wire
return nil
}
// Health Check``
// @Summary Responds to health check
// @Description Description
// @Tags Base
// @Accept json
// @Produce json
// @Success 200 {object} string
// @Failure 404 {object} string
// @Router / [get]
func healthHandler(w http.ResponseWriter, r *http.Request) {
var okRender HealthStatus
okRender.Status = "ok"
render.Render(w, r, &okRender)
}