view-api 3.0.1 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Run directly with `npx`:
|
|
|
24
24
|
# simpler way
|
|
25
25
|
npx view-api dev
|
|
26
26
|
|
|
27
|
-
or
|
|
27
|
+
# or
|
|
28
28
|
|
|
29
29
|
# use your own file
|
|
30
30
|
npx view-api dev <file-path>
|
|
@@ -40,7 +40,7 @@ view-api dev
|
|
|
40
40
|
## 🚀 Usage
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
view-api dev <
|
|
43
|
+
view-api dev <file-path> [options]
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
### Options
|
|
@@ -63,13 +63,21 @@ Then you will have running editor and the API endpoint:
|
|
|
63
63
|
➜ EDITOR running at http://localhost:4001
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
### Behavior Options
|
|
67
|
+
|
|
68
|
+
| Option | Description |
|
|
69
|
+
| ------------- | ---------------------------------------------- |
|
|
70
|
+
| `successRate` | Determine how much the request success rate |
|
|
71
|
+
| `delay` | Determine how long the request will be delayed |
|
|
72
|
+
|
|
66
73
|
## 📄 Mock Config Format
|
|
67
74
|
|
|
68
75
|
```json
|
|
69
76
|
{
|
|
70
77
|
"GET /products": {
|
|
71
78
|
"behavior": {
|
|
72
|
-
"successRate": 50
|
|
79
|
+
"successRate": 50,
|
|
80
|
+
"delay": 1000
|
|
73
81
|
},
|
|
74
82
|
"responses": {
|
|
75
83
|
"success": {
|