feat: 实现配置加载系统与多级目录递归扫描
- 定义支持“一接口一文件”与“一文件多接口”的数据模型 - 实现基于路径首段的 HashMap 索引构建逻辑 - 新增集成测试 tests/integration_test.rs,验证 YAML 解析与目录递归加载 - 优化 Cargo.toml 配置,解决连字符项目名引用问题
This commit is contained in:
12
src/main.rs
12
src/main.rs
@@ -1,3 +1,9 @@
|
||||
fn main() {
|
||||
println!("Hello, mock-server!");
|
||||
}
|
||||
// 使用项目名(下划线形式)引用 lib 中的内容
|
||||
use mock_server::loader::MockLoader;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
// 你的启动逻辑...
|
||||
let index = MockLoader::load_all_from_dir(std::path::Path::new("./mocks"));
|
||||
println!("服务启动中...");
|
||||
}
|
||||
Reference in New Issue
Block a user