|
3 | 3 | ## Configuration files |
4 | 4 |
|
5 | 5 | - Dev Proxy configuration file is named devproxyrc.json or devproxyrc.jsonc (if you want to include comments) |
6 | | -- Dev Proxy also supports YAML configuration files named devproxyrc.yaml or devproxyrc.yml (v2.2.0+). When creating a YAML config, use `devproxy config new --format yaml`. |
7 | | -- To validate a configuration file before starting Dev Proxy, use `devproxy config validate` (v2.2.0+). |
| 6 | +- Dev Proxy also supports YAML configuration files named devproxyrc.yaml or devproxyrc.yml. When creating a YAML config, use `devproxy config new --format yaml`. |
| 7 | +- To validate a configuration file before starting Dev Proxy, use `devproxy config validate`. |
8 | 8 | - For clarity, store all Dev Proxy files in the .devproxy folder in the workspace |
9 | 9 | - When creating new configuration files, use the available tools to find out which Dev Proxy version the user has installed and use it. Schema version must match the installed Dev Proxy version. |
10 | 10 | - If the project already has Dev Proxy files, use the same version for compatibility. |
|
39 | 39 | - When defining mock responses or CrudApiPlugin actions, put entries with the longest (most specific) URLs first. Entries are matched in the order they're defined, so you don't want a generic pattern like /{id} to override a more specific one like /category/{name}. |
40 | 40 | - Mocks with the nth property should be defined first, because they're considered more specific than mocks without that property. |
41 | 41 | - To return dynamic Retry-After header value in mock responses, use `@dynamic` as the header's value |
42 | | -- To return a dynamic Retry-After header value with a specific initial value, use `@dynamic=initialvalue` (e.g. `@dynamic=120`). Supported in GenericRandomErrorPlugin (v2.2.0+). |
| 42 | +- To return a dynamic Retry-After header value with a specific initial value, use `@dynamic=initialvalue` (e.g. `@dynamic=120`). Supported in GenericRandomErrorPlugin. |
43 | 43 | - When simulating APIs and their responses, consider using the LatencyPlugin to make the API responses feel more realistic. See the Plugins section for the correct plugin ordering. |
44 | 44 |
|
45 | 45 | ## File paths |
|
48 | 48 |
|
49 | 49 | ## Hot reload |
50 | 50 |
|
51 | | -- Dev Proxy supports hot reload of configuration files (v2.1.0+). When you modify a configuration file while Dev Proxy is running, it automatically detects the changes and restarts with the new configuration. |
| 51 | +- Dev Proxy supports hot reload of configuration files. When you modify a configuration file while Dev Proxy is running, it automatically detects the changes and restarts with the new configuration. |
52 | 52 | - Hot reload works for all configuration file types: the main configuration file (JSON, JSONC, or YAML) and plugin-specific configuration files (mock files, CRUD API data files, etc.). |
53 | 53 | - You don't need to manually restart Dev Proxy after making configuration changes - just save the file and the changes take effect automatically. |
54 | | -- To disable hot reload (e.g. in CI/CD or automated environments), use the `--no-watch` flag (v2.2.0+). |
| 54 | +- To disable hot reload (e.g. in CI/CD or automated environments), use the `--no-watch` flag. |
55 | 55 |
|
56 | 56 | ## Detached mode |
57 | 57 |
|
58 | | -- Dev Proxy can run in detached (background) mode (v2.2.0+). This is useful for CI/CD pipelines, automated testing, and agent-driven workflows where Dev Proxy needs to run without an interactive terminal. |
| 58 | +- Dev Proxy can run in detached (background) mode. This is useful for CI/CD pipelines, automated testing, and agent-driven workflows where Dev Proxy needs to run without an interactive terminal. |
59 | 59 | - When running in detached mode, use `--output json` to get structured, machine-readable output that can be parsed by scripts and agents. |
60 | 60 | - For detached mode and CI/CD scenarios, set `port` to `0` in the configuration file (or use `--port 0` on the command line) to let the OS assign a random available port. This avoids port conflicts when running multiple Dev Proxy instances in parallel. Similarly, use `--api-port 0` for the Dev Proxy API port. |
61 | 61 | - Combine random ports with `asSystemProxy` set to `false` in the configuration file (or `--as-system-proxy false` on the command line) to prevent Dev Proxy from modifying system proxy settings. This way, each instance runs in isolation and only intercepts requests from applications explicitly configured to use its address and port. |
62 | | -- When `asSystemProxy` is `false`, multiple Dev Proxy instances can run in parallel on the same machine (v2.3.0+). Each instance should use its own random port and configuration file. |
| 62 | +- When `asSystemProxy` is `false`, multiple Dev Proxy instances can run in parallel on the same machine. Each instance should use its own random port and configuration file. |
63 | 63 | - When using random ports, use `devproxy status` to find the actual assigned port, API URL, PID, and other details of the running instance. |
64 | | -- The proxy URL is printed in the startup output (v2.3.0+). When using `--output json`, parse the proxy URL from the JSON output to configure your application. |
| 64 | +- The proxy URL is printed in the startup output. When using `--output json`, parse the proxy URL from the JSON output to configure your application. |
65 | 65 |
|
66 | 66 | ## curl |
67 | 67 |
|
|
0 commit comments