feat: add /healthz endpoint and test coverage for health check

Closes: #2493
This commit is contained in:
Luis Pater
2026-04-02 21:56:27 +08:00
parent 3171d524f0
commit 7ee37ee4b9
2 changed files with 27 additions and 0 deletions

View File

@@ -317,6 +317,10 @@ func NewServer(cfg *config.Config, authManager *auth.Manager, accessManager *sdk
// setupRoutes configures the API routes for the server.
// It defines the endpoints and associates them with their respective handlers.
func (s *Server) setupRoutes() {
s.engine.GET("/healthz", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"status": "ok"})
})
s.engine.GET("/management.html", s.serveManagementControlPanel)
openaiHandlers := openai.NewOpenAIAPIHandler(s.handlers)
geminiHandlers := gemini.NewGeminiAPIHandler(s.handlers)