apimock-rs 4.6.0 → 4.6.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 +31 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# apimock-rs (API Mock)
|
|
2
2
|
|
|
3
|
-
](https://www.npmjs.com/package/apimock-rs)
|
|
4
4
|
[](https://github.com/apimokka/apimock-rs/blob/main/LICENSE)
|
|
5
5
|
|
|
6
6
|
[](https://crates.io/crates/apimock)
|
|
@@ -38,6 +38,8 @@ curl http://localhost:3001/api/v1/hello
|
|
|
38
38
|
# --> {"hello":"world"}
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
You may also check it out with browser to visit http://localhost:3001/api/v1/hello .
|
|
42
|
+
|
|
41
43
|
You now have a running REST endpoint.
|
|
42
44
|
|
|
43
45
|
### Customization
|
|
@@ -75,12 +77,12 @@ npm run dev
|
|
|
75
77
|
|
|
76
78
|
### `npx apimock` variation
|
|
77
79
|
|
|
78
|
-
| command |
|
|
80
|
+
| command | result |
|
|
79
81
|
| --- | --- |
|
|
80
|
-
| `npx apimock` | Run with all default parameters |
|
|
81
|
-
| `npx apimock -p 4000` | Run with custom port |
|
|
82
|
-
| `npx apimock -d tests` | Run with custom root dir on server response |
|
|
83
|
-
| `npx apimock -c apimock.toml` | Run with config file giving rich features |
|
|
82
|
+
| `npx apimock` | Run with all default parameters. |
|
|
83
|
+
| `npx apimock -p 4000` | Run with custom port. |
|
|
84
|
+
| `npx apimock -d tests/integration` | Run with custom root dir on server response. |
|
|
85
|
+
| `npx apimock -c apimock.toml` | Run with config file giving rich features. Running `npx apimock --init` beforehand is required. |
|
|
84
86
|
|
|
85
87
|
## Mock APIs easily 🎈 — just JSON and go
|
|
86
88
|
|
|
@@ -91,6 +93,29 @@ All you have to do to start up is just use folders and JSON without any config s
|
|
|
91
93
|
- 🌬️ Fast to boot, light on memory.
|
|
92
94
|
- 🪄 File-based and rule-based matching. Scripting supported.
|
|
93
95
|
|
|
96
|
+
### When to use `apimock-rs` ?
|
|
97
|
+
|
|
98
|
+
- The backend is not ready yet.
|
|
99
|
+
- You need stable API responses for UI testing.
|
|
100
|
+
- You want offline development.
|
|
101
|
+
- CI tests require a predictable API.
|
|
102
|
+
- Your mock data is becoming large.
|
|
103
|
+
|
|
104
|
+
### Handles real project scale
|
|
105
|
+
|
|
106
|
+
As your project grows, your mock API grows, too. Large mock datasets often cause problems:
|
|
107
|
+
|
|
108
|
+
- Slow startup
|
|
109
|
+
- High memory usage
|
|
110
|
+
- Crashes during UI testing
|
|
111
|
+
- Unstable CI runs
|
|
112
|
+
|
|
113
|
+
apimock-rs does not preload responses. Each response file is read only when a request arrives using non-blocking I/O. This keeps (validated with k6 load testing):
|
|
114
|
+
|
|
115
|
+
- Startup nearly instant
|
|
116
|
+
- Memory usage minimal
|
|
117
|
+
- Stable behavior under repeated requests
|
|
118
|
+
|
|
94
119
|
### 📖 Documentation
|
|
95
120
|
|
|
96
121
|
For more details, **🧭 check out [the docs](https://apimokka.github.io/apimock-rs/)**.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apimock-rs",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.2",
|
|
4
4
|
"description": "A developer-friendly, featherlight and functional HTTP(S) mock server built in Rust.",
|
|
5
5
|
"author": "nabbisen<nabbisen@scqr.net>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"postinstall": "node postinstall.js"
|
|
20
20
|
},
|
|
21
21
|
"optionalDependencies": {
|
|
22
|
-
"@apimock-rs/bin-linux-x64-gnu": "4.6.
|
|
23
|
-
"@apimock-rs/bin-darwin-arm64": "4.6.
|
|
24
|
-
"@apimock-rs/bin-win32-x64-msvc": "4.6.
|
|
22
|
+
"@apimock-rs/bin-linux-x64-gnu": "4.6.2",
|
|
23
|
+
"@apimock-rs/bin-darwin-arm64": "4.6.2",
|
|
24
|
+
"@apimock-rs/bin-win32-x64-msvc": "4.6.2"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [
|
|
27
27
|
"api",
|