This commit is contained in:
parent
27929b8039
commit
bb14c6215b
1 changed files with 7 additions and 1 deletions
8
main.go
8
main.go
|
@ -23,7 +23,13 @@ func init() {
|
|||
func main() {
|
||||
|
||||
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
|
||||
writer.Write([]byte(s))
|
||||
_, gloableRes := checkSystem()
|
||||
if gloableRes {
|
||||
writer.Write([]byte(s))
|
||||
} else {
|
||||
http.Error(writer, s, http.StatusInternalServerError)
|
||||
}
|
||||
writer.Write([]byte("Fatal Error"))
|
||||
})
|
||||
http.HandleFunc("/data.json", handler)
|
||||
err := http.ListenAndServe(c.HTTP.Listen, nil)
|
||||
|
|
Loading…
Reference in a new issue