From 7f52bcc9bc664f527e79d06e26d28076e9f3609a Mon Sep 17 00:00:00 2001 From: Zherphy <1123678689@qq.com> Date: Sat, 12 Oct 2024 14:43:53 +0800 Subject: [PATCH] ADD: add hello api add hello api --- server/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/server.go b/server/server.go index 746aa27..e8c6e52 100644 --- a/server/server.go +++ b/server/server.go @@ -96,6 +96,7 @@ func New(o Options) (http.Handler, error) { r := chi.NewRouter() r.Post("/{owner}/{repo}/objects/batch", s.handleBatch) + r.Get("/", s.healthCheck) return r, nil } @@ -234,6 +235,10 @@ func (s *server) handleBatch(w http.ResponseWriter, r *http.Request) { must(json.NewEncoder(w).Encode(resp)) } +func (s *server) healthCheck(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("Hello, World!")) +} + // -- func must(err error) {