Skip to content

Commit

Permalink
[FEAT] adding ready endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolastakashi committed Oct 19, 2021
1 parent 843415e commit 497e3ed
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ func createHttpServer(port string) *http.Server {

rw.Write(jsonResp)
})
mux.HandleFunc("/-/ready", func(rw http.ResponseWriter, _ *http.Request) {
rw.WriteHeader(http.StatusOK)
rw.Header().Set("Content-Type", "application/json")

resp := map[string]string{
"message": "Ready",
}

jsonResp, err := json.Marshal(resp)

if err != nil {
log.Fatalf("Error happened in JSON marshal. Err: %s", err)
}

rw.Write(jsonResp)
})

srv := &http.Server{
Addr: port,
Expand Down

0 comments on commit 497e3ed

Please sign in to comment.