mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
17 lines
360 B
Go
17 lines
360 B
Go
|
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)
|
||
|
})
|
||
|
}
|