- 在后端处理程序中添加了新的健康检查路由`/health` - 该路由用于支持Caddy等反向代理的健康检查功能 此更改增强了服务的可监控性和可靠性。
This commit is contained in:
@ -84,6 +84,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
// 额外的根路径健康检查,用于Caddy等反向代理
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 根路径健康检查
|
||||
Method: http.MethodGet,
|
||||
Path: "/health",
|
||||
Handler: health.HealthHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user