apollo-backend/internal/api/health.go

19 lines
364 B
Go
Raw Permalink Normal View History

package api
2021-05-10 00:51:15 +00:00
import (
"encoding/json"
"net/http"
"github.com/julienschmidt/httprouter"
)
func (a *api) healthCheckHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
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")
json.NewEncoder(w).Encode(data)
}