| Crates.io | jimjam |
| lib.rs | jimjam |
| version | 0.0.2 |
| created_at | 2026-01-20 13:18:40.270613+00 |
| updated_at | 2026-01-20 13:30:29.86496+00 |
| description | A configurable HTTP mock server with YAML-defined responses |
| homepage | https://github.com/michaelmccabe/jimjam |
| repository | https://github.com/michaelmccabe/jimjam |
| max_upload_size | |
| id | 2056532 |
| size | 108,919 |
A configurable HTTP mock server that serves responses based on YAML-defined rules. Perfect for API mocking, testing, and development.
/users/{id}cargo build --release
cargo run
The server starts on http://127.0.0.1:8080 by default.
curl http://127.0.0.1:8080/api/health
# → {"status": "ok", "service": "jimjam"}
config/config.yaml)# jimjam main configuration
server:
host: "127.0.0.1"
port: 8080
# Location of mock response definition files
mock_files:
directory: "./mocks"
patterns:
- "**/*.yaml"
- "**/*.yml"
hot_reload: true
mocks:
path: "/api/users/{id}" id: "1" status: 200 {"id": 1, "name": "Alice"}
| Condition | Description | Example |
|---|---|---|
path_params |
Match URL path parameters | id: "123" |
query_params |
Exact query parameter match | sort: "asc" |
query_contains |
Query string substring | "category=books" |
headers |
Exact header match | Authorization: "Bearer token" |
header_contains |
Header substring | Authorization: "Bearer" |
body_contains |
Body substring | '"role": "admin"' |
body_json |
JSON field match | name: "test" |
body_regex |
Regex pattern | '"email":\\s*".*@test\\.com"' |
- status: 201 # HTTP status code
headers: # Response headers
Content-Type: "application/json"
X-Custom-Header: "value"
body: | # Inline response body
{"created": true}
body: "@./data/large.json" # Or use @ prefix to load from file
body_file: "./data/large.json" # Alternative: explicit file reference
delay_ms: 2000 # Simulate slow response
Inline body - Write content directly in YAML
body: '{"name": "example"}'
File reference with @ - Prefix path with @ (recommended)
body: "@./mocks/data/users.json"
Explicit body_file - Use separate field
body_file: "./mocks/data/users.json"
jimjam/
├── config/
│ └── config.yaml # Server configuration
├── mocks/
│ ├── users.yaml # User API mocks
│ ├── products.yaml # Product API mocks
│ └── data/
│ └── products.json # Large response bodies
└── src/
└── ...
cargo test
See how-jimjam-works.md for schema, matching, and advanced usage.