This commit is contained in:
parent
27929b8039
commit
bb14c6215b
1 changed files with 7 additions and 1 deletions
6
main.go
6
main.go
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue