Skip to content

Commit

Permalink
Merge pull request jamestelfer#45 from cultureamp/healthcheck
Browse files Browse the repository at this point in the history
fix: add super-simple healthcheck endpoint
  • Loading branch information
jamestelfer committed May 14, 2024
2 parents 176b1b5 + feedf64 commit 8612d73
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ func configureServerRoutes(cfg config.Config) (http.Handler, error) {

mux.Handle("POST /token", authorized.Then(handlePostToken(tokenVendor)))
mux.Handle("POST /git-credentials", authorized.Then(handlePostGitCredentials(tokenVendor)))
mux.Handle("GET /healthcheck", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
defer drainRequestBody(r)

w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
}))

return mux, nil
}
Expand Down

0 comments on commit 8612d73

Please sign in to comment.