Skip to content

Commit

Permalink
Fix: Healthz check path
Browse files Browse the repository at this point in the history
  • Loading branch information
arnonsang committed Jul 7, 2024
1 parent ab49b2f commit 8c0314e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions presentation/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ func (s *Server) setupRoutes() {
s.e.GET("/api/replacer/:sentence", s.sentenceReplacer)
s.e.POST("/api/replacer", s.sentenceReplacer)
s.e.GET("/healthz", func(c echo.Context) error {
return c.String(http.StatusOK, "OK")
res := map[string]string{"status": "ok"}
return c.JSON(http.StatusOK, res)
})
}

Expand All @@ -75,7 +76,7 @@ func (s *Server) getWord(c echo.Context) error {
n = 1
}
if n < 1 {
c.JSON(http.StatusBadRequest, "n must be greater than 0")
c.JSON(http.StatusBadRequest, map[string]string{"error": "n must be greater than 0"})
}
return c.JSON(http.StatusOK, s.usecase.GetWord(n))
}
Expand Down

0 comments on commit 8c0314e

Please sign in to comment.