zrok/endpoints/frontend/health_ui/handler.go
2022-09-07 12:22:22 -04:00

22 lines
357 B
Go

package health_ui
import (
"github.com/sirupsen/logrus"
"net/http"
)
func WriteHealthOk(w http.ResponseWriter) {
if data, err := FS.ReadFile("index.html"); err == nil {
w.WriteHeader(http.StatusOK)
n, err := w.Write(data)
if n != len(data) {
logrus.Errorf("short write")
return
}
if err != nil {
logrus.Error(err)
return
}
}
}