error-pages/internal/http/handlers/live/handler.go

17 lines
360 B
Go
Raw Normal View History

2024-06-22 20:05:11 +00:00
package live
import (
"net/http"
)
// New creates a new handler that always returns "OK" with status code 200.
func New() http.Handler {
var body = []byte("OK")
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusOK)
_, _ = w.Write(body)
})
}