From 67b70c80e7bdf9e3fa8dd77bfa1f8424f27ff5e0 Mon Sep 17 00:00:00 2001 From: xujiang Date: Wed, 16 Jul 2025 15:22:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=A0=B9=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在后端处理程序中添加了新的健康检查路由`/health` - 该路由用于支持Caddy等反向代理的健康检查功能 此更改增强了服务的可监控性和可靠性。 --- backend/internal/handler/routes.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/backend/internal/handler/routes.go b/backend/internal/handler/routes.go index 322ff3b..972330d 100644 --- a/backend/internal/handler/routes.go +++ b/backend/internal/handler/routes.go @@ -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{ {