Skip to content

Commit

Permalink
refactor: move health check endpoint to a more appropriate location i…
Browse files Browse the repository at this point in the history
…n main.go to prevent gin wildcard handing in openai mode
  • Loading branch information
Gyarbij committed Jan 24, 2025
1 parent 67980e8 commit 3355b1f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ func init() {
func main() {
router := gin.Default()

// Health check endpoint
router.GET("/healthz", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"status": "healthy",
})
})

// Proxy routes
if ProxyMode == "azure" {
router.GET("/v1/models", handleGetModels)
Expand Down Expand Up @@ -122,6 +115,13 @@ func main() {
router.Any("*path", handleOpenAIProxy)
}

// Health check endpoint
router.GET("/healthz", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"status": "healthy",
})
})

router.Run(Address)
}

Expand Down

0 comments on commit 3355b1f

Please sign in to comment.