🚀 Dynamic Mock API
A powerful, flexible mock server to simulate REST & GraphQL APIs with customizable behavior—ideal for frontend development, integration testing, and rapid prototyping.
🌟 What Is It?
Dynamic Mock API lets you:
- Define endpoints via a web interface
- Return custom JSON responses
- Simulate authentication, rate limits, delays, and more
- Mock GraphQL queries and mutations
- Use dynamic variables in responses
Whether you're building web apps, mobile clients, or testing backend integrations—this tool helps you simulate real-world APIs effortlessly.
✨ Key Features
| Feature | Description |
|---|---|
| 🧩 Easy Endpoint Setup | Register REST/GraphQL endpoints using a friendly UI |
| 📄 JSON Mock Responses | Return static or dynamic JSON responses |
| 🔒 Authentication | Support for Basic Auth and Bearer Token validation |
| ⏱️ Rate Limiting | Limit number of requests per time window |
| ⏳ Configurable Delays | Simulate network latency in milliseconds |
| 🔁 Custom HTTP Status Codes | Return success, redirects, client or server error responses |
| 📊 Request Logging | Logs every request with metadata |
| 🧪 GraphQL Support | Define mock responses for queries and mutations |
| 🧠 Dynamic Response Variables | Insert request values into your JSON response (e.g., path/query/header) |
| 🔌 gRPC Simulation | Mock gRPC service calls using HTTP-based endpoints |
⚙️ Installation & Setup
🔧 Prerequisites
- Rust: Install Rust
- Node.js + npm: Install Node.js (LTS version recommended)
🏗️ Build & Run
Linux / macOS
Windows
Access the App
Open your browser: http://localhost:3001
📚 Usage Examples
1️⃣ Register a Simple GET Endpoint
Create a file hello.json:
Register in UI:
| Path | Method | Response |
|---|---|---|
/api/hello |
GET | hello.json |
2️⃣ Dynamic Response Variables
Register in UI:
| Path | Dynamic Vars |
|---|---|
/api/user/{id}/item/{item}?name={name} |
✅ |
Request:
GET /api/user/123/item/laptop?name=John
Response:
3️⃣ GraphQL Mock Example
Check graphql.json in uploads folder
Request:
Or:
Response (automatically matched):
1️⃣ Simulate a gRPC Call
You can simulate gRPC service methods via HTTP by registering an endpoint with the following structure:
Example: POST /grpc → will be the default endpoint
Fill the form with the information required and register the following json:
Then do a POST to /grpc with the following request body:
The response will be the contents of the json registered
🧠 Why Use This?
| Benefit | Description |
|---|---|
| ✅ Developer-Friendly | Configure endpoints easily through a UI—no need to edit JSON or YAML files |
| 🚫 No Java Required | Built in Rust, so there’s no need for a Java runtime or heavy frameworks |
| ⚙️ Feature-Rich | Includes auth, delays, rate limiting, and dynamic vars out of the box |
| 🔁 Instant Mock Updates | Change responses on the fly without restarting or redeploying |
| 🌍 Language-Agnostic | Works with any tech stack that supports HTTP requests |
| 🧪 GraphQL Support | Simulate GraphQL queries and mutations with minimal setup |
| 🔐 Authentication | Easily test Basic or Token-protected endpoints |