HTTP/REST Mock Server
Mock REST APIs with simple YAML configuration. 50K+ requests per second, sub-millisecond latency. Record real API traffic and replay it offline.
Complete HTTP Mocking
Everything you need to mock HTTP APIs for development, testing, and demos.
Request Matching
Match requests by URL path, query params, headers, body content, and HTTP method. Use regex for flexible pattern matching.
Dynamic Responses
Template responses with request data, random values, timestamps, and UUIDs. Build realistic API behavior.
Latency Simulation
Add configurable delays to simulate real network conditions. Test timeout handling and loading states.
Stateful Mocking
Maintain state across requests. Simulate CRUD operations with in-memory data persistence.
Record & Replay
Proxy to real APIs and record responses. Replay recorded traffic for offline development.
Fault Injection
Simulate errors, timeouts, and malformed responses. Test error handling and resilience.
Simple YAML Configuration
Define endpoints, responses, and matching rules in clean YAML. No code required. Works with your existing CI/CD workflows.
- Path parameters: Extract values from URL paths
- Body matching: JSONPath, regex, and exact matching
- Template helpers: UUIDs, timestamps, random data
- Auto TLS: Automatic certificate generation
# mockd.yaml - HTTP Mock Configuration
version: "1.0"
admins:
- name: local
port: 4290
engines:
- name: default
httpPort: 4280
admin: local
workspaces:
- name: default
engines: [default]
mocks:
- id: list-users
workspace: default
type: http
http:
matcher:
method: GET
path: /api/users
response:
statusCode: 200
headers:
Content-Type: application/json
body: |
{"users": [
{"id": 1, "name": "Alice"},
{"id": 2, "name": "Bob"}
], "total": 2}
- id: get-user
workspace: default
type: http
http:
matcher:
method: GET
path: /api/users/{id}
response:
statusCode: 200
body: |
{"id": "{{request.pathParam.id}}",
"name": "User {{request.pathParam.id}}",
"createdAt": "{{now}}"}
- id: create-user
workspace: default
type: http
http:
matcher:
method: POST
path: /api/users
bodyJsonPath:
"$.email": ".*@.*"
response:
statusCode: 201
body: |
{"id": "{{uuid}}",
"email": "{{request.body.email}}",
"created": true}Built for Modern Development
From local development to CI pipelines. Mockd fits your workflow.
Frontend Development
Build UIs without waiting for backend APIs. Mock endpoints to unblock your team.
Integration Testing
Test API integrations with deterministic responses. No flaky tests from external dependencies.
CI/CD Pipelines
Run tests offline in your CI pipeline. Fast, reliable, and reproducible.
API Prototyping
Design and share API contracts before implementation. Validate schemas early.
Why Mockd?
Built for performance and simplicity. No JVM, no Node.js, no Docker required.
| Comparison | Other Mock Servers | Mockd |
|---|---|---|
| Startup time | 5-30 seconds (JVM, Node) | <10ms (native binary) |
| Memory usage | 200MB+ typical | <30MB footprint |
| Throughput | 1-5K req/s typical | 50K+ req/s sustained |
| Configuration | JSON, Java DSL, or code | Simple YAML format |
| Multi-protocol | HTTP only or plugins | 7 protocols built-in |
| TLS/mTLS | Often requires setup | Zero-config auto-certs |
Start Mocking HTTP APIs in Seconds
Single binary. No dependencies. Just download and run.
mockd init && mockd up