From 3546224c07b723101984781cfef17aa3c610f90b Mon Sep 17 00:00:00 2001 From: sunist-c Date: Thu, 14 Nov 2024 11:21:07 +0800 Subject: [PATCH] =?UTF-8?q?feat(helath):=20=E6=B7=BB=E5=8A=A0=E5=81=A5?= =?UTF-8?q?=E5=BA=B7=E6=A3=80=E6=9F=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/router/framework.go | 13 +++++++++++++ app/router/router.go | 1 + 2 files changed, 14 insertions(+) create mode 100644 app/router/framework.go diff --git a/app/router/framework.go b/app/router/framework.go new file mode 100644 index 0000000..8013a15 --- /dev/null +++ b/app/router/framework.go @@ -0,0 +1,13 @@ +package router + +import "github.com/alioth-center/infrastructure/network/http" + +var frameworkRouter = http.NewRouter("framework") + +var FrameworkRouterGroup = []http.EndPointInterface{ + http.NewEndPointBuilder[http.NoBody, http.NoResponse](). + SetAllowMethods(http.GET). + SetRouter(frameworkRouter.Group("/health")). + SetHandlerChain(http.NewChain(http.EmptyHandler[http.NoBody, http.NoResponse]())). + Build(), +} diff --git a/app/router/router.go b/app/router/router.go index 355115e..3994f99 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -9,6 +9,7 @@ func serveBackend() { engine := http.NewEngine(global.Config.HttpEngine.ServeURL) engine.AddEndPoints(OpenAiCompatibleRouterGroup...) + engine.AddEndPoints(FrameworkRouterGroup...) if global.Config.HttpEngine.EnableManagementApis { engine.AddEndPoints(ManagementRouterGroup...)