apimock-rs
🛠️ App overhaul announcement
⚠️ Major update in development (v4)
v4 introduces a fundamental shift in design. Existing configuration files will no longer work as-is. Some features will be deprecated. In return: cleaner configs, dynamic resolution, and better extensibility.
Summary
HTTP server generating REST/JSON responses. Aims to be mocking helper to develop microservices and APIs. Written in Rust and based on hyper.
Running apimock or apimock -c apimock.toml starts the server. Built as small single native binary. Supports cross-platform.
Screenshots
Server started to listen:

curl test result:

Middleware is available as rhai script:

Reference
Usage
Executable
Assets in Releases offer executables for multiple platforms.
At startup, --init option is available to gerenate app configuration and customization files:
Customization
- Able to customize by modifying config file (
./apimock.tomlby default) and restarting app. - Dynamic routing directory is also available (
./apimock-dyn-data/by default) even without config file. App returns response by associating request URL path with relative file path under it. - When app runs without both
./apimock.tomland./apimock-dyn-data/directory,alwaysoption is automatically activated to return fixed response.
cargo install
# after installed:
Acknowledgements
Depends on:
tokio / hyper / toml / serde / serde_json / json5 / console / rhai. In addition, mdbook (as to workflows)