docs: 更新README文档并改进错误处理

- 在README.md文件中添加获取项目列表的API接口文档说明。
- 将服务启动代码中的错误处理从 `unwrap()` 改为更安全的 `?` 操作符以传播错误。
This commit is contained in:
2025-08-21 11:28:50 +08:00
parent 8a1f2cee94
commit 806480adb1
2 changed files with 4 additions and 3 deletions

View File

@@ -38,8 +38,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.route("/project", get(get_projects))
.with_state(state);
let listener = tokio::net::TcpListener::bind("0.0.0.0:3009").await.unwrap();
axum::serve(listener, app).await.unwrap();
let listener = tokio::net::TcpListener::bind("0.0.0.0:3009").await?;
axum::serve(listener, app).await?;
Ok(())
}