Skip to content

Commit

Permalink
feat(helath): 添加健康检查接口
Browse files Browse the repository at this point in the history
  • Loading branch information
sunist-c committed Nov 14, 2024
1 parent fcbd7d2 commit 3546224
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/router/framework.go
Original file line number Diff line number Diff line change
@@ -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(),
}
1 change: 1 addition & 0 deletions app/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
Expand Down

0 comments on commit 3546224

Please sign in to comment.