Skip to content

Commit

Permalink
update health check function
Browse files Browse the repository at this point in the history
Signed-off-by: viveksahu26 <vivekkumarsahu650@gmail.com>
  • Loading branch information
viveksahu26 committed Sep 14, 2022
1 parent 4cc3f9e commit 4edcb1d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,8 @@ func handleShortURL(writer http.ResponseWriter, req *http.Request) {
}

func healthCheckUp(w http.ResponseWriter, r *http.Request) {
method := r.Method
if method == "GET" {
w.WriteHeader(http.StatusOK)
w.Write([]byte("Health of Server is UP & Running..."))
} else {
w.WriteHeader(http.StatusMethodNotAllowed)
}
w.WriteHeader(http.StatusOK)
w.Write([]byte("Health of Server is UP & Running..."))
}

const addr = "localhost:8080"
Expand Down

0 comments on commit 4edcb1d

Please sign in to comment.