Skip to content

7.3 新增 Public API

路线

  1. web/src/pages/api/public/** 建 route。
  2. withMiddlewares 包 method handler。
  3. createAuthedProjectAPIRoute 做鉴权、限流、Zod 校验。
  4. request/response schema 放 web/src/features/public-api/types/**
  5. 更新 Fern。
  6. 更新 generated outputs / SDK 相关类型。
  7. 写 API 测试。

自检

  • response schema 是否 strict?
  • 是否有 pagination 或时间窗口?
  • 错误格式是否稳定?
  • Fern 是否同步?

下一节

新增 Worker Job