gui http status code
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Kekskurse 2021-09-20 23:28:24 +02:00
parent 27929b8039
commit bb14c6215b
Signed by: kekskurse
GPG key ID: 728ACCB59341E7E4

View file

@ -23,7 +23,13 @@ func init() {
func main() { func main() {
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) { http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
_, gloableRes := checkSystem()
if gloableRes {
writer.Write([]byte(s)) writer.Write([]byte(s))
} else {
http.Error(writer, s, http.StatusInternalServerError)
}
writer.Write([]byte("Fatal Error"))
}) })
http.HandleFunc("/data.json", handler) http.HandleFunc("/data.json", handler)
err := http.ListenAndServe(c.HTTP.Listen, nil) err := http.ListenAndServe(c.HTTP.Listen, nil)