diff --git a/server/server.go b/server/server.go index 746aa27..16b48a5 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("/hello", s.helloCheck) return r, nil } @@ -234,6 +235,14 @@ func (s *server) handleBatch(w http.ResponseWriter, r *http.Request) { must(json.NewEncoder(w).Encode(resp)) } +func (s *server) helloCheck(w http.ResponseWriter, r *http.Request) { + _, err := w.Write([]byte("Hello, World!")) + if err != nil { + err = errors.New("health check failed") + return + } +} + // -- func must(err error) {