zrok/endpoints/frontend/notfound_ui/handler.go
2022-09-07 14:17:08 -04:00

22 lines
365 B
Go

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