apimock-rs 4.6.1 → 4.6.3
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 +13 -12
- 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)
|
|
@@ -21,7 +21,7 @@ Drop JSON files into a folder and your API immediately exists.
|
|
|
21
21
|
Easy to start with [npm package](https://www.npmjs.com/package/apimock-rs).
|
|
22
22
|
|
|
23
23
|
```sh
|
|
24
|
-
# install
|
|
24
|
+
# install into your app project
|
|
25
25
|
npm install -D apimock-rs
|
|
26
26
|
# and go
|
|
27
27
|
npx 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/
|
|
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/apimock-dyn-route` | 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,9 +93,7 @@ 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
|
|
|
94
|
-
### When
|
|
95
|
-
|
|
96
|
-
Use it when:
|
|
96
|
+
### When to use `apimock-rs` ?
|
|
97
97
|
|
|
98
98
|
- The backend is not ready yet.
|
|
99
99
|
- You need stable API responses for UI testing.
|
|
@@ -101,7 +101,7 @@ Use it when:
|
|
|
101
101
|
- CI tests require a predictable API.
|
|
102
102
|
- Your mock data is becoming large.
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
### Handles real project scale
|
|
105
105
|
|
|
106
106
|
As your project grows, your mock API grows, too. Large mock datasets often cause problems:
|
|
107
107
|
|
|
@@ -116,7 +116,8 @@ apimock-rs does not preload responses. Each response file is read only when a re
|
|
|
116
116
|
- Memory usage minimal
|
|
117
117
|
- Stable behavior under repeated requests
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
as validated with k6 load testing.
|
|
120
|
+
You can run UI development and automated tests continuously without worrying about server instability.
|
|
120
121
|
|
|
121
122
|
### 📖 Documentation
|
|
122
123
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apimock-rs",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.3",
|
|
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.3",
|
|
23
|
+
"@apimock-rs/bin-darwin-arm64": "4.6.3",
|
|
24
|
+
"@apimock-rs/bin-win32-x64-msvc": "4.6.3"
|
|
25
25
|
},
|
|
26
26
|
"keywords": [
|
|
27
27
|
"api",
|