@pb33f/wiretap 0.0.13 → 0.0.14
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 +25 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -11,15 +11,33 @@ This is an early tool and in active development.
|
|
|
11
11
|
Probably best to leave this one alone for now, come back later
|
|
12
12
|
when it's a little more baked.
|
|
13
13
|
|
|
14
|
+
## Configuring paths & rewriting them.
|
|
15
|
+
|
|
16
|
+
Provide a configuration for path rewriting via the wiretap config.
|
|
17
|
+
|
|
18
|
+
This uses the same syntax for path rewriting as the [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware)
|
|
19
|
+
|
|
20
|
+
Paths can be matched by globs and then individual segments can be matched and re-written.
|
|
21
|
+
|
|
22
|
+
```yaml
|
|
23
|
+
paths:
|
|
24
|
+
/pb33f/*/test/**:
|
|
25
|
+
target: localhost:80
|
|
26
|
+
pathRewrite:
|
|
27
|
+
'^/pb33f/(\w+)/test/': ''
|
|
28
|
+
```
|
|
29
|
+
|
|
14
30
|
## Command Line Interface
|
|
15
31
|
|
|
16
32
|
### Available Flags
|
|
17
33
|
|
|
18
|
-
| Shortcut | Flag
|
|
19
|
-
|
|
20
|
-
| `-u` | `--url`
|
|
21
|
-
| `-s` | `--spec`
|
|
22
|
-
| `-p` | `--port`
|
|
34
|
+
| Shortcut | Flag | Description |
|
|
35
|
+
|----------|-----------------|--------------------------------------------------------------------------------------------|
|
|
36
|
+
| `-u` | `--url` | Redirect URL for wiretap to send traffic to. |
|
|
37
|
+
| `-s` | `--spec` | Path to the OpenAPI Specification to use. |
|
|
38
|
+
| `-p` | `--port` | Port on which to listen for API traffic. (default is `9090`) |
|
|
23
39
|
| `-m` | `--monitor-port` | Port on which to serve the monitor UI. (default is `9091`) |
|
|
24
|
-
| `-d` | `--delay`
|
|
25
|
-
| `-c` | `--config`
|
|
40
|
+
| `-d` | `--delay` | Set a global delay for all API requests in milliseconds. (default is `0`) |
|
|
41
|
+
| `-c` | `--config` | Location of wiretap configuration file to use (default is `.wiretap` in current directory) |
|
|
42
|
+
| `-t` | `--static` | Location of static files to serve along with API requests (simulate real app deployment) |
|
|
43
|
+
|
package/package.json
CHANGED