feat(dev-server): 添加开发模式 HTTP/WebSocket 服务器
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
功能: - 创建 dev_server.rs 模块,提供 HTTP/WebSocket API - 使用 feature flag \dev-server\ 控制编译 - 仅绑定 localhost:50051,安全限制 CORS - 生产构建不包含此模块 使用方式: - pnpm tauri:dev:web - 启动带开发服务器的 Tauri - pnpm tauri:dev - 常规开发模式(无服务器) 安全: - 仅 localhost 绑定 - CORS 限制为 Vite 开发端口 - 通过 feature flag 完全移除生产代码
This commit is contained in:
@@ -15,6 +15,10 @@ crate-type = ["staticlib", "cdylib", "rlib"]
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "2", features = [] }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
dev-server = ["axum", "tower-http"]
|
||||
|
||||
[dependencies]
|
||||
# ZCLAW crates
|
||||
zclaw-types = { workspace = true }
|
||||
@@ -66,3 +70,7 @@ rand = { workspace = true }
|
||||
|
||||
# SQLite (keep for backward compatibility during migration)
|
||||
sqlx = { workspace = true }
|
||||
|
||||
# Development server (optional, only for debug builds)
|
||||
axum = { version = "0.7", features = ["ws"], optional = true }
|
||||
tower-http = { version = "0.5", optional = true }
|
||||
|
||||
Reference in New Issue
Block a user