feat: 新增根路径健康检查路由
All checks were successful
部署后端服务 / 🚀 构建并部署 (push) Successful in 1m55s

- 在后端处理程序中添加了新的健康检查路由`/health`
- 该路由用于支持Caddy等反向代理的健康检查功能

此更改增强了服务的可监控性和可靠性。
This commit is contained in:
xujiang
2025-07-16 15:22:54 +08:00
parent 964126953a
commit 67b70c80e7

View File

@ -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{
{