Add first version of UI
This commit is contained in:
1 parent
f1497bec49
commit
88c35e30b4
4 files changed
+137
-24
No files matched your search
@@ -12,7 +12,7 @@ func main() {
|
||||
go watchdog.Monitor()
|
||||
http.HandleFunc("/api/v1/results", serviceResultsHandler)
|
||||
http.HandleFunc("/health", healthHandler)
|
||||
http.HandleFunc("/", indexHandler)
|
||||
http.Handle("/", http.FileServer(http.Dir("./static")))
|
||||
log.Println("[main][main] Listening on port 80")
|
||||
log.Fatal(http.ListenAndServe(":80", nil))
|
||||
}
|
||||
@@ -23,11 +23,6 @@ func serviceResultsHandler(writer http.ResponseWriter, request *http.Request) {
|
||||
_, _ = writer.Write(structToJsonBytes(serviceResults))
|
||||
}
|
||||
|
||||
func indexHandler(writer http.ResponseWriter, request *http.Request) {
|
||||
writer.WriteHeader(http.StatusNotImplemented)
|
||||
_, _ = writer.Write(structToJsonBytes(&core.ServerMessage{Error: true, Message: "Not implemented yet"}))
|
||||
}
|
||||
|
||||
func healthHandler(writer http.ResponseWriter, request *http.Request) {
|
||||
writer.WriteHeader(http.StatusOK)
|
||||
_, _ = writer.Write(structToJsonBytes(&core.HealthStatus{Status: "UP"}))
|
||||
|
||||
Reference in new issue
Block a user