Skip to content

Commit

Permalink
add health check
Browse files Browse the repository at this point in the history
  • Loading branch information
chkpwd committed Dec 18, 2023
1 parent 9d52db9 commit 3f43e17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func main() {

fmt.Printf("Active Port:%v\n", portNum)

// Health check
http.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
})

err := http.ListenAndServe(fmt.Sprintf(":%v", portNum), nil)
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit 3f43e17

Please sign in to comment.