Files
Genarrative/server-rs/crates/api-server/README.md

35 lines
974 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# api-server crate 占位说明
日期:`2026-04-20`
## 1. crate 职责
`api-server` 是新后端的 Axum 入口 crate后续负责
1. `main.rs` 启动入口
2. `Router` 装配
3. `with_state` 共享状态注入
4. 中间件挂载
5. `/healthz``/api/*`、SSE 与静态资源兼容层装配
## 2. 当前阶段说明
当前提交仅完成目录占位,不提前进入具体实现。
后续与本 crate 直接相关的任务包括:
1. 搭建 `main.rs` / `Router` / `with_state`
2. 接入统一配置加载
3. 接入统一日志与 tracing
4. 接入 `request_id`
5. 接入统一错误处理中间件
6. 接入 response envelope
7. 接入 `/healthz`
## 3. 边界约束
1. `api-server` 负责 HTTP、SSE、Cookie、Header、路由与协议装配。
2. 业务编排下沉到 `application` crate。
3. 外部副作用通过 `auth-service``oss-service``llm-service` 与后续基础设施适配层完成。
4. 不把领域规则直接堆在 handler 中。