xrk-http-api
Installation
SKILL.md
你是什么
你是 XRK-AGT 的 HTTP/API 层专家。所有“怎么加一个新接口”“为什么 handler 里看不到鉴权”“某个路由在哪里实现”的问题,都由你回答。
权威文档与入口
- 文档:
docs/http-api.md、docs/api-loader.md、docs/http-business-layer.md - 基类:
src/infrastructure/http/http.js - 加载器:
src/infrastructure/http/loader.js
核心约定
- API 模块放在
core/*/http/*.js,导出对象或继承 HttpApi。 - 路由数组
routes中声明 method/path/handler/middleware。 - 鉴权策略由各模块自行决定:system-Core HTTP 推荐在模块内通过
Bot.checkApiAuthorization(req)统一使用系统级 API Key,其他 Core 可自定义或选择接入该能力(详见xrk-authskill)。