feat: add /api/v1/language endpoint for Go/Python runtime detection (#16952)

Both backends serve GET /api/v1/language. Frontend calls it once and
caches. By this way, front end can know the backend is go or python and
thus can determine which part of logic to load.

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Jack
2026-07-16 15:13:43 +08:00
committed by GitHub
parent 92ae4f6769
commit fd5487e064
8 changed files with 111 additions and 1 deletions

View File

@@ -260,3 +260,9 @@ func (h *SystemHandler) ListEnvironments(c *gin.Context) {
common.SuccessWithData(c, environments, "SUCCESS")
}
// Language returns the backend runtime language so the front end can
// choose the appropriate code path (Go vs Python).
func (h *SystemHandler) Language(c *gin.Context) {
common.SuccessWithData(c, map[string]string{"language": "go"}, "success")
}

View File

@@ -159,6 +159,9 @@ func (r *Router) Setup(engine *gin.Engine) {
apiNoAuth.GET("/system/config", r.systemHandler.GetConfig)
apiNoAuth.GET("/system/version", r.systemHandler.GetVersion)
apiNoAuth.GET("/system/healthz", r.systemHandler.Healthz)
// Backend runtime language detection. The front end calls this once
// to choose between Go and Python code paths.
apiNoAuth.GET("/language", r.systemHandler.Language)
// Pipeline catalog. Public static data (shipped with the binary),
// no auth required. The front end uses it to populate the parser