| Crates.io | mockiapi |
| lib.rs | mockiapi |
| version | 0.1.8 |
| created_at | 2025-03-23 20:05:54.785983+00 |
| updated_at | 2025-04-17 22:09:43.779598+00 |
| description | A flexible, feature-rich mock API server with an intuitive frontend that simplifies development. |
| homepage | |
| repository | https://github.com/sfeSantos/mockiapi |
| max_upload_size | |
| id | 1602997 |
| size | 222,066 |
A powerful, flexible mock server to simulate REST & GraphQL APIs with customizable behavior—ideal for frontend development, integration testing, and rapid prototyping.
Dynamic Mock API lets you:
Whether you're building web apps, mobile clients, or testing backend integrations—this tool helps you simulate real-world APIs effortlessly.
| 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 |
cd mockiapi
chmod +x init.sh
./init.sh
double-click init.bat
Open your browser: http://localhost:3001
Create a file hello.json:
{ "message": "Hello, world!" }
Register in UI:
| Path | Method | Response |
|---|---|---|
/api/hello |
GET | hello.json |
{
"message": "Hello, {{name}}!",
"user_id": "{{id}}",
"requested_item": "{{item}}",
"timestamp": "{{timestamp}}"
}
Register in UI:
| Path | Dynamic Vars |
|---|---|
/api/user/{id}/item/{item}?name={name} |
✅ |
Request:
GET /api/user/123/item/laptop?name=John
Response:
{
"message": "Hello, John!",
"user_id": "123",
"requested_item": "laptop",
"timestamp": "2025-03-31T12:00:00Z"
}
Check graphql.json in uploads folder
Request:
{ "query": "query getUser { id name email }" }
Or:
{ "query": "mutation createUser { success user { id name email } }" }
Response (automatically matched):
{
"data": {
"id": "123",
"name": "Alice",
"email": "alice@example.com"
}
}
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:
{
"id": "b123",
"title": "The Rust Programming Language",
"author": "Steve Klabnik"
}
Then do a POST to /grpc with the following request body:
{
"service": "com.example.BookService",
"rpc": "GetBook",
"request": { "id": "b123" }
}
The response will be the contents of the json registered
| 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 |