From ee4c68cfba1d0793e8509ce160ce7e2916aa8408 Mon Sep 17 00:00:00 2001 From: Joakim Hulthe Date: Mon, 1 Feb 2021 15:27:13 +0100 Subject: [PATCH] Add basic healthcheck route --- cmd/lookbuilding/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/lookbuilding/main.go b/cmd/lookbuilding/main.go index 7b3d503..5a4fdb1 100644 --- a/cmd/lookbuilding/main.go +++ b/cmd/lookbuilding/main.go @@ -24,6 +24,11 @@ func main() { fmt.Fprintf(w, "OK") }) + http.HandleFunc("/healthcheck", func(w http.ResponseWriter, r *http.Request) { + // TODO: if the last scan errored, this should not return OK + fmt.Fprintf(w, "OK") + }) + fs := http.FileServer(http.Dir("static/")) http.Handle("/static/", http.StripPrefix("/static/", fs))