Basic information
About mockapi-instant-rest-api-from-json
Spin up a mock REST API server from JSON files in seconds. Full CRUD, filtering, pagination. Zero config. Free CLI tool for frontend developers.
mockapi-instant-rest-api-from-json is an agent skill listed in the AddMCP.net directory, published by openclaw. Source code is hosted on github.com.
Overview
What is mockapi-instant-rest-api-from-json?
name: MockAPI - Instant REST API from JSON description: Spin up a mock REST API server from JSON files in seconds. Full CRUD, filtering, pagination. Zero config. Free CLI tool for frontend developers.
MockAPI
Create a REST API from a JSON file. Perfect for frontend development, testing, prototyping.
What it does
- Full CRUD operations
- Automatic ID generation
- Filtering and pagination
- Sorting
- CORS enabled
- Hot reload with --watch
- Persistent changes to JSON
Installation
npm install -g @lxgicstudios/mockapiQuick Start
# Create example db.json
npx @lxgicstudios/mockapi --init
# Start server
npx @lxgicstudios/mockapi db.jsonData File Format
Create db.json:
{
"users": [
{ "id": 1, "name": "Alice", "email": "[email protected]" },
{ "id": 2, "name": "Bob", "email": "[email protected]" }
],
"posts": [
{ "id": 1, "title": "Hello", "body": "Content", "userId": 1 }
]
}Generated Routes
For each resource (users, posts):
| Method | Route | Description | |--------|-------|-------------| | GET | /users | List all | | GET | /users/:id | Get by id | | POST | /users | Create | | PUT | /users/:id | Replace | | PATCH | /users/:id | Update | | DELETE | /users/:id | Delete |
Query Parameters
# Filter
GET /users?name=Alice
# Pagination
GET /users?_page=1&_limit=10
# Sort
GET /users?_sort=name&_order=ascOptions
| Option | Description | |--------|-------------| | -p, --port | Port (default: 3001) | | -d, --delay | Response delay in ms | | -w, --watch | Watch file for changes | | -r, --readonly | Disable mutations | | --init | Create example db.json |
Comments
No comments yet
Be the first to share feedback about this listing. Sign in to leave a comment.
Sign In