Refactor health check and user management endpoints for improved structure and clarity
- Replaced the existing health check endpoint with a new handler at `/admin/v1/health` to align with the updated API structure. - Introduced a dedicated `health.go` file to encapsulate health check logic and response formatting. - Updated Swagger documentation to reflect the new health check endpoint and its response structure. - Refined user management routes to enhance clarity and maintainability, including changes to login, logout, and profile management endpoints. - Ensured all user-related endpoints are now prefixed appropriately and documented in Swagger for better API usability.
This commit is contained in:
@@ -116,13 +116,7 @@ func initHTTPServer(conf infra.Config, log logger.Logger) *echo.Echo {
|
||||
})
|
||||
|
||||
// Add health check endpoint
|
||||
e.GET("/health", func(c echo.Context) error {
|
||||
return c.JSON(http.StatusOK, map[string]interface{}{
|
||||
"status": "healthy",
|
||||
"time": time.Now().Unix(),
|
||||
"version": "1.0.0",
|
||||
})
|
||||
})
|
||||
e.GET("/admin/v1/health", healthHandler)
|
||||
|
||||
// Add Swagger documentation endpoint
|
||||
e.GET("/swagger/*", echoSwagger.WrapHandler)
|
||||
|
||||
Reference in New Issue
Block a user