Skip to content

Commit

Permalink
ADD: add hello api
Browse files Browse the repository at this point in the history
add hello api
  • Loading branch information
Zherphy committed Oct 12, 2024
1 parent 63e677a commit 7f52bcc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7f52bcc

Please sign in to comment.