refactor: reorganize gateway API routes under /api/ prefix #177

Closed
opened 2026-05-11 07:37:47 +00:00 by xingyue · 0 comments
Owner

What

Gateway 的路由目前散落在根路径,不够整洁。重新组织到 /api/ 前缀下。

Why

当前路由结构混乱,管理接口(register、endpoints)和代理转发混在一起,缺乏清晰的层次。

Changes

当前:

POST   /register
DELETE /register/:name
GET    /endpoints
ALL    /api/:agent/*
GET    /healthz

目标:

POST   /api/gateway/register
DELETE /api/gateway/register/:name
GET    /api/gateway/endpoints
ALL    /api/agents/:agent/*
GET    /healthz
  • /healthz 保留根级别(CF/k8s 惯例)
  • Gateway 自身管理接口归到 /api/gateway/
  • 代理转发路径改为 /api/agents/:agent/*,更语义化

Ref

涉及文件:

  • packages/workflow-gateway/src/index.ts
  • packages/cli-workflow/src/commands/serve/serve.ts(注册/心跳的请求路径)
  • packages/workflow-dashboard/src/api.ts(调用端路径)
## What Gateway 的路由目前散落在根路径,不够整洁。重新组织到 `/api/` 前缀下。 ## Why 当前路由结构混乱,管理接口(register、endpoints)和代理转发混在一起,缺乏清晰的层次。 ## Changes 当前: ``` POST /register DELETE /register/:name GET /endpoints ALL /api/:agent/* GET /healthz ``` 目标: ``` POST /api/gateway/register DELETE /api/gateway/register/:name GET /api/gateway/endpoints ALL /api/agents/:agent/* GET /healthz ``` - `/healthz` 保留根级别(CF/k8s 惯例) - Gateway 自身管理接口归到 `/api/gateway/` - 代理转发路径改为 `/api/agents/:agent/*`,更语义化 ## Ref 涉及文件: - `packages/workflow-gateway/src/index.ts` - `packages/cli-workflow/src/commands/serve/serve.ts`(注册/心跳的请求路径) - `packages/workflow-dashboard/src/api.ts`(调用端路径)
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#177