mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 01:47:47 +08:00
将 gateway 内部的 model-fetch、provider-transport、scheduler-core、 usage-runtime、video-tasks-core 模块提取为独立 crate;重构 gateway 内部模块结构(state/router/cache/data/query 等);移除大量遗留模块 文件;新增 systemd 二进制部署骨架及相关文档;更新前端 usage 相关 API 和组件。
24 lines
743 B
Rust
24 lines
743 B
Rust
use axum::routing::{any, get, post};
|
|
use axum::Router;
|
|
|
|
use crate::{
|
|
handlers::proxy::proxy_request,
|
|
state::AppState,
|
|
tunnel::{
|
|
proxy_tunnel, relay_request, PROXY_TUNNEL_PATH, TUNNEL_HEARTBEAT_PATH,
|
|
TUNNEL_NODE_STATUS_PATH, TUNNEL_RELAY_PATH_PATTERN,
|
|
},
|
|
};
|
|
|
|
pub(crate) fn mount_internal_routes(router: Router<AppState>) -> Router<AppState> {
|
|
router
|
|
.route(
|
|
"/api/internal/gateway/{*internal_gateway_path}",
|
|
any(proxy_request),
|
|
)
|
|
.route(PROXY_TUNNEL_PATH, get(proxy_tunnel))
|
|
.route(TUNNEL_HEARTBEAT_PATH, post(proxy_request))
|
|
.route(TUNNEL_NODE_STATUS_PATH, post(proxy_request))
|
|
.route(TUNNEL_RELAY_PATH_PATTERN, post(relay_request))
|
|
}
|