diff --git a/kubernetes-manifests/frontend.yaml b/kubernetes-manifests/frontend.yaml index 4f62e77..d921a8f 100644 --- a/kubernetes-manifests/frontend.yaml +++ b/kubernetes-manifests/frontend.yaml @@ -30,7 +30,7 @@ spec: readinessProbe: initialDelaySeconds: 10 httpGet: - path: "/" + path: "/_healthz" port: 8080 httpHeaders: - name: "Cookie" diff --git a/src/frontend/main.go b/src/frontend/main.go index c3dd3c7..dccf4c8 100644 --- a/src/frontend/main.go +++ b/src/frontend/main.go @@ -121,7 +121,8 @@ func main() { r.HandleFunc("/logout", svc.logoutHandler).Methods(http.MethodGet) r.HandleFunc("/cart/checkout", svc.placeOrderHandler).Methods(http.MethodPost) r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static/")))) - r.HandleFunc("/robots.txt", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, "User-agent: *\nDisallow: /") }) + r.HandleFunc("/robots.txt", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, "User-agent: *\nDisallow: /") }) + r.HandleFunc("/_healthz", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, "ok") }) var handler http.Handler = r handler = &logHandler{log: log, next: handler} // add logging