feat: 添加HTTP接口支持Postman测试

- 添加 tiny_http 依赖用于HTTP服务器
- 守护进程自动启动HTTP服务器(端口=TCP端口+1)
- 添加 /synthesize 接口(POST)
- 添加 /health 健康检查接口(GET)
- 测试通过: curl 和 mimo-tts send 命令
This commit is contained in:
2026-04-25 06:34:54 +08:00
parent 19eb313bef
commit 96b3aa4a37
5 changed files with 171 additions and 0 deletions

31
Cargo.lock generated
View File

@@ -110,6 +110,12 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "ascii"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16"
[[package]]
name = "atomic-waker"
version = "1.1.2"
@@ -243,6 +249,12 @@ dependencies = [
"windows-link",
]
[[package]]
name = "chunked_transfer"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e4de3bc4ea267985becf712dc6d9eed8b04c953b3fcfb339ebc87acd9804901"
[[package]]
name = "clang-sys"
version = "1.8.1"
@@ -766,6 +778,12 @@ version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "httpdate"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hyper"
version = "1.9.0"
@@ -1222,6 +1240,7 @@ dependencies = [
"rodio",
"serde",
"serde_json",
"tiny_http",
"tokio",
"tokio-util",
"toml",
@@ -2123,6 +2142,18 @@ dependencies = [
"syn",
]
[[package]]
name = "tiny_http"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "389915df6413a2e74fb181895f933386023c71110878cd0825588928e64cdc82"
dependencies = [
"ascii",
"chunked_transfer",
"httpdate",
"log",
]
[[package]]
name = "tinystr"
version = "0.8.3"