mockaton 8.3.3 → 8.3.4
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 +8 -5
- package/package.json +1 -1
- package/src/config.js +1 -1
package/README.md
CHANGED
|
@@ -13,10 +13,13 @@ URL paths. For example, the following file will be served on `/api/user/1234`
|
|
|
13
13
|
my-mocks-dir/api/user/[user-id].GET.200.json
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
## Scraping Mocks
|
|
17
|
+
You don’t need to mock all your APIs. Mockaton can request
|
|
18
|
+
from your backend the routes you don’t have mocks for. That’s done with:
|
|
19
|
+
|
|
20
|
+
`config.proxyFallback = 'http://mybackend'`
|
|
21
|
+
|
|
22
|
+
`config.collectProxied = true` lets you save those responses as mocks following the filename convention.
|
|
20
23
|
|
|
21
24
|
## Multiple Mock Variants
|
|
22
25
|
Each route can have many mocks, which could either be:
|
|
@@ -420,7 +423,7 @@ function capitalizePlugin(filePath) {
|
|
|
420
423
|
|
|
421
424
|
|
|
422
425
|
### `corsAllowed?: boolean`
|
|
423
|
-
Defaults to `
|
|
426
|
+
Defaults to `true`. When `true`, these are the default options:
|
|
424
427
|
```js
|
|
425
428
|
config.corsOrigins = ['*']
|
|
426
429
|
config.corsMethods = ['GET', 'PUT', 'DELETE', 'POST', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT']
|
package/package.json
CHANGED