1.1.8 • Published 4 years ago
mock-ui v1.1.8
MOCK SERVER
Easily mock server responses for apps with an easy to use GUI on your local device.
Whats New?
Please update to new the newest version to have a better experience.
- Data Persistence.
- Better Error Handling.
Upcoming features
- Support for more HTTP verbs.
- Switch between profiles from UI.
- Inline JSON Editor.
- Integration with your Projects.
- VSCODE extension.
- GRAPHQL support
- More flexibility.
Features
- Interactive UI
- Working API in 3 clicks
- Runs Locally
- Data Persistence
Cross platform
Installation
Install mock-ui with npm
npm install -g mock-ui
mock-uiAPI Reference
For now all requests are post
Get all users
POST http://localhost:8008/routesAdd user
POST http://localhost:8008/user/addGet routes for a user
POST http://localhost:8008/api/:user-id| Parameter | Type | Description |
|---|---|---|
user-id | string | Required. id of your user |
Add a route
POST http://localhost:8008/routes/add{
"id": "1Qupx5C5BU",
"route": "users",
"response": {
"name": "John Doe",
"age": 20
}
}| Parameter | Type | Description |
|---|---|---|
id | string | Required. id of your user |
route | string | Required. name of route |
response | string | Required. JSON that will be returned as response |
Query a route
POST http://localhost:8008/:user-id/:route| Parameter | Type | Description |
|---|---|---|
id | string | Required. id of your user |
route | string | Required. name of route |
Update the response of a route
PATCH http://localhost:8008/routes/update{
"id": "1Qupx5C5BU",
"route": "users",
"response": {
"name": "Jane Doe",
"email": "jane@email.com",
"age": 25
}
}| Parameter | Type | Description |
|---|---|---|
id | string | Required. id of your user |
route | string | Required. name of route |
response | string | Required. JSON that will be returned as response |
Delete a route
DELETE http://localhost:8008/routes/del{
"id": "yWqkIj5riP",
"route": "users"
}| Parameter | Type | Description |
|---|---|---|
id | string | Required. id of your user |
route | string | Required. name of route |
Clone
Clone the project
git clone https://github.com/elliot40404/mock-server.git mock-uiGo to the project directory
cd mock-uiInstall dependencies
npm installStart the server
npm run startCreate a link to run globally
npm linkContributing
Contributions are always welcome!
Tech Stack
Client: VUE3
Server: Node, Express
Checkout https://chaos-8ef21.web.app/ for an web editor