apollo-backend/internal/api/health.go
2021-07-13 13:14:25 -04:00

18 lines
364 B
Go

package api
import (
"encoding/json"
"net/http"
"github.com/julienschmidt/httprouter"
)
func (a *api) healthCheckHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
data := map[string]string{
"status": "available",
}
w.WriteHeader(http.StatusOK)
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(data)
}