24 lines
384 B
Go
24 lines
384 B
Go
package httpapi
|
|
|
|
import "net/http"
|
|
|
|
func handleHealth(w http.ResponseWriter, r *http.Request) {
|
|
if r.Method != http.MethodGet {
|
|
w.Header().Set("Allow", http.MethodGet)
|
|
|
|
writeError(
|
|
w,
|
|
http.StatusMethodNotAllowed,
|
|
"invalid_request",
|
|
"Method not allowed",
|
|
)
|
|
return
|
|
}
|
|
|
|
writeJSON(w, http.StatusOK, struct {
|
|
Status string `json:"status"`
|
|
}{
|
|
Status: "ok",
|
|
})
|
|
}
|