Skip to content

Commit

Permalink
Feat: Modified the Heartbeat API to integrate with the GAAS
Browse files Browse the repository at this point in the history
  • Loading branch information
KazeNoYumeX committed Mar 12, 2024
1 parent 0ba681b commit 626b74b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Backend/service/delivery/http/v1/heartbeat_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type HeartbeatHandler struct {
func RegisterHeartbeatHandler(opts *HeartbeatHandler) {
handler := &HeartbeatHandler{}

opts.Engine.GET("/api/v1/heartbeat", handler.Heartbeat)
opts.Engine.GET("/api/v1/health", handler.Heartbeat)
}

// Heartbeat godoc
Expand All @@ -23,7 +23,7 @@ func RegisterHeartbeatHandler(opts *HeartbeatHandler) {
// @Accept json
// @Produce json
// @Success 204
// @Router /api/v1/heartbeat [GET]
// @Router /api/v1/health [GET]
func (g *HeartbeatHandler) Heartbeat(c *gin.Context) {
c.JSON(http.StatusNoContent, http.NoBody)
}
4 changes: 2 additions & 2 deletions Backend/tests/e2e/hearbeat_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ func TestHeartbeatEndpoint(t *testing.T) {
router := gin.Default()

// Set up the heartbeat endpoint
router.GET("/api/v1/heartbeat", func(c *gin.Context) {
router.GET("/api/v1/health", func(c *gin.Context) {
c.Status(http.StatusNoContent)
})

// Prepare a new HTTP request
req, _ := http.NewRequest("GET", "/api/v1/heartbeat", nil)
req, _ := http.NewRequest("GET", "/api/v1/health", nil)

// Create a response recorder
res := httptest.NewRecorder()
Expand Down

0 comments on commit 626b74b

Please sign in to comment.