nabbisen / apimock-rs
API mock Server generating HTTP/JSON responses written in Rust
apimock-rs
Summary
Mocking helper to develop microservices and APIs. hyper-based HTTP server generating REST responses containing JSON ones. Written in Rust.
With small native binary, just run ./apimock
or ./apimock -c apimock.toml
to start the server !
Screenshots
Server started to listen:
curl
test result:
Features
1. Basic
- GET / POST methods
- Multiple
paths
- Multiple .json/.json5 files treated as JSON Response
- based on hyper v1
2. Customization
- Custom HTTP response codes: 3xx as redirects, and 4xx and 5xx as errors
- Custom response headers which are reusable
- Flexible responses with patterns and jsonpath queries. Even with the same API URL path, multiple responses can be returned. See
url.paths_patterns
- Can specify response time on all or each API path
3. Dynamic processing
- Can switch data directory paths manually in testing via specific HTTP request to make json responses flexible
- Dynamic path resolution with
dyn_data_dir
4. Usability
- Validates…
The binaries on Win/Mac/Linux are available thanks to Rust. They are "out-of-the-box" 💫
Top comments (2)
Renamed to apimock-rs. Now more than returning JSON data.
github.com/nabbisen/apimock-rs
Update:
1.0.2:
Minor changes released. Delivery format was improved.