apollo-backend/internal/api/health.go

17 lines
307 B
Go
Raw Normal View History

package api
2021-05-10 00:51:15 +00:00
import (
"encoding/json"
"net/http"
)
2021-08-08 18:19:47 +00:00
func (a *api) healthCheckHandler(w http.ResponseWriter, r *http.Request) {
2021-05-10 00:51:15 +00:00
data := map[string]string{
"status": "available",
}
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json")
2021-09-25 13:19:42 +00:00
_ = json.NewEncoder(w).Encode(data)
2021-05-10 00:51:15 +00:00
}