| Crates.io | RustMock |
| lib.rs | RustMock |
| version | 0.3.3 |
| created_at | 2025-12-19 16:31:46.872361+00 |
| updated_at | 2025-12-20 17:18:07.295808+00 |
| description | Lightning-fast, lightweight API mock server with OpenAPI support and beautiful React dashboard |
| homepage | https://github.com/arthurkowalsky/Rust-Mock |
| repository | https://github.com/arthurkowalsky/Rust-Mock |
| max_upload_size | |
| id | 1995078 |
| size | 930,426 |
Lightning-fast API mock server built in Rust with beautiful React dashboard
~35MB Docker image | Blazing fast | Full OpenAPI support | Smart proxy mode
Docker:
docker run -p 8090:8090 ghcr.io/arthurkowalsky/rust-mock:latest
CLI (Cargo):
cargo install RustMock
mokku
Open http://localhost:8090 - done!
mokku command or Docker one-linercargo install RustMock
| Command | Description |
|---|---|
mokku |
Interactive mode - guided setup |
mokku server |
Start server directly |
mokku import <file> |
Import OpenAPI spec |
mokku mock <method> <path> [status] [body] |
Quick mock creation |
# Start with custom port
mokku server -p 3000
# Start with proxy to production API
mokku --proxy https://api.production.com
# Import OpenAPI and start server
mokku import openapi.yaml --start --open
# Quick mock endpoint
mokku mock POST /api/users 201 '{"id": 1, "name": "John"}'
| Flag | Description |
|---|---|
-p, --port <PORT> |
Server port (default: 8090) |
--host <HOST> |
Bind address (default: 0.0.0.0) |
--proxy <URL> |
Default proxy URL |
-o, --open |
Auto-open browser |
docker run -p 8090:8090 ghcr.io/arthurkowalsky/rust-mock:latest
docker run -p 8090:8090 \
-v $(pwd)/openapi.json:/app/openapi.json \
-e OPENAPI_FILE=/app/openapi.json \
ghcr.io/arthurkowalsky/rust-mock:latest
version: '3'
services:
rustmock:
image: ghcr.io/arthurkowalsky/rust-mock:latest
ports:
- "8090:8090"
volumes:
- ./openapi.json:/app/openapi.json
environment:
- OPENAPI_FILE=/app/openapi.json
- DEFAULT_PROXY_URL=https://api.production.com # optional
| Endpoint | Method | Description |
|---|---|---|
/__mock/endpoints |
POST | Add endpoint |
/__mock/endpoints |
PUT | Update endpoint |
/__mock/endpoints |
DELETE | Remove endpoint |
/__mock/config |
GET | Get all endpoints |
/__mock/logs |
GET | Get request logs |
/__mock/logs |
DELETE | Clear logs |
/__mock/import |
POST | Import OpenAPI spec |
/__mock/export |
GET | Export as OpenAPI |
/__mock/proxy |
GET/POST/DELETE | Manage proxy |
curl -X POST http://localhost:8090/__mock/endpoints \
-H "Content-Type: application/json" \
-d '{
"method": "GET",
"path": "/api/users",
"response": [{"id": 1, "name": "John"}],
"status": 200
}'
curl -X POST http://localhost:8090/__mock/import \
-H "Content-Type: application/json" \
-d '{"openapi_spec": <your-openapi-json>}'
Route unmocked requests to a real API:
# Via CLI
mokku --proxy https://api.production.com
# Via Docker
docker run -p 8090:8090 -e DEFAULT_PROXY_URL=https://api.production.com ghcr.io/arthurkowalsky/rust-mock:latest
# Via API
curl -X POST http://localhost:8090/__mock/proxy \
-H "Content-Type: application/json" \
-d '{"url": "https://api.production.com"}'
Mock specific endpoints while proxying the rest to production.
| Argument | Default | Description |
|---|---|---|
--host |
0.0.0.0 |
Server host |
--port |
8090 |
Server port |
--default-proxy-url |
- | Proxy URL for unmocked requests |
| Variable | Description |
|---|---|
OPENAPI_FILE |
Path to OpenAPI spec for auto-import |
DEFAULT_PROXY_URL |
Default proxy URL |
CLI arguments take precedence over environment variables.
RustMock consists of:
git checkout -b feature/amazing)git commit -m 'Add amazing feature')git push origin feature/amazing)MIT License - see LICENSE