Skip to content

Commit

Permalink
Provide /healthz
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyll committed Sep 9, 2024
1 parent c806a2c commit c821b12
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/proxy-to-gemini/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ func main() {
defer client.Close()

r := mux.NewRouter()
r.HandleFunc("/", indexHandler)
r.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "ok")
})
switch api {
case "openai":
openai.RegisterHandlers(r, client)
case "ollama":
ollama.RegisterHandlers(r, client)
}
r.HandleFunc("/", indexHandler)

log.Printf("Starting server on %v", hostport)
if err := http.ListenAndServe(hostport, r); err != nil {
Expand Down

0 comments on commit c821b12

Please sign in to comment.