feat: initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// HealthCheck godoc
|
||||
//
|
||||
// @Summary Health Check
|
||||
// @Description Health Check
|
||||
// @Tags ops
|
||||
// @Success 204 {string} string "ok"
|
||||
// @Failure 500 {object} error "Internal Server Error"
|
||||
// @Router /health [get]
|
||||
func (api *api) healthCheckHandler(w http.ResponseWriter, r *http.Request) {
|
||||
data := map[string]string{
|
||||
"status": "ok",
|
||||
"env": api.config.env,
|
||||
"version": version,
|
||||
}
|
||||
|
||||
if err := api.jsonResponse(w, http.StatusOK, data); err != nil {
|
||||
api.internalServerError(w, r, err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user