偶然看到一个 Json server 的 Rust 库 weld. 感觉挺好玩的, 但是代码比较老了, 试着用 actix-web 2.0 和 serde_json 重新实现了一个, 代码更简单了.
项目地址: mockrs
使用说明:
cargo install --git https://github.com/PrivateRookie/mockrs.git
mockrs --help
mockrs 0.1.0
PrivateRookie <[email protected]>
a mock restful json http server
USAGE:
mockrs [OPTIONS] <db-file>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
--host <host> listen ip [env: MOCKRS_HOST=] [default: 127.0.0.1]
--port <port> listen port [env: MOCKRS_PORT=9002] [default: 9000]
ARGS:
<db-file> json file as database [env: MOCKRS_DB_FILE=]