Skip to content

Commit 075341d

Browse files
Move config files to .devproxy folder and remove default property values
Co-authored-by: waldekmastykarz <11164679+waldekmastykarz@users.noreply.github.com>
1 parent d186856 commit 075341d

7 files changed

Lines changed: 12 additions & 24 deletions

File tree

samples/api-degradation-scenarios/devproxyrc.json renamed to samples/api-degradation-scenarios/.devproxy/devproxyrc.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
"urlsToWatch": [
2929
"https://api.example.com/*"
3030
],
31-
"logLevel": "information",
32-
"labelMode": "text",
3331
"latencyPlugin": {
3432
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/latencyplugin.schema.json",
3533
"minMs": 3000,
@@ -38,9 +36,7 @@
3836
"rateLimitingPlugin": {
3937
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/ratelimitingplugin.schema.json",
4038
"costPerRequest": 1,
41-
"rateLimit": 10,
42-
"resetTimeWindowSeconds": 60,
43-
"warningThresholdPercent": 50
39+
"rateLimit": 10
4440
},
4541
"genericRandomErrorPlugin": {
4642
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/genericrandomerrorplugin.schema.json",

samples/api-degradation-scenarios/errors-503.json renamed to samples/api-degradation-scenarios/.devproxy/errors-503.json

File renamed without changes.

samples/api-degradation-scenarios/intermittent-errors.devproxyrc.json renamed to samples/api-degradation-scenarios/.devproxy/intermittent-errors.devproxyrc.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
"urlsToWatch": [
1717
"https://api.example.com/*"
1818
],
19-
"logLevel": "information",
20-
"labelMode": "text",
2119
"genericRandomErrorPlugin": {
2220
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/genericrandomerrorplugin.schema.json",
2321
"errorsFile": "errors-503.json",

samples/api-degradation-scenarios/rate-limiting.devproxyrc.json renamed to samples/api-degradation-scenarios/.devproxy/rate-limiting.devproxyrc.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@
1616
"urlsToWatch": [
1717
"https://api.example.com/*"
1818
],
19-
"logLevel": "information",
20-
"labelMode": "text",
2119
"rateLimitingPlugin": {
2220
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/ratelimitingplugin.schema.json",
2321
"costPerRequest": 1,
24-
"rateLimit": 10,
25-
"resetTimeWindowSeconds": 60,
26-
"warningThresholdPercent": 50
22+
"rateLimit": 10
2723
}
2824
}

samples/api-degradation-scenarios/slow-responses.devproxyrc.json renamed to samples/api-degradation-scenarios/.devproxy/slow-responses.devproxyrc.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
"urlsToWatch": [
1212
"https://api.example.com/*"
1313
],
14-
"logLevel": "information",
15-
"labelMode": "text",
1614
"latencyPlugin": {
1715
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/latencyplugin.schema.json",
1816
"minMs": 3000,

samples/api-degradation-scenarios/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ You can also run Dev Proxy with specific configurations:
5757
This configuration combines all three degradation scenarios: intermittent 503 errors (30% of requests), rate limiting (10 requests per minute), and slow responses (3-5 seconds latency).
5858

5959
```bash
60-
devproxy
60+
devproxy --config-file .devproxy/devproxyrc.json
6161
```
6262

6363
Test with:
@@ -71,7 +71,7 @@ curl -ikx http://127.0.0.1:8000 https://api.example.com/data
7171
This configuration simulates random 503 Service Unavailable errors for 30% of requests.
7272

7373
```bash
74-
devproxy --config-file intermittent-errors.devproxyrc.json
74+
devproxy --config-file .devproxy/intermittent-errors.devproxyrc.json
7575
```
7676

7777
Test with:
@@ -85,7 +85,7 @@ curl -ikx http://127.0.0.1:8000 https://api.example.com/data
8585
This configuration simulates hitting rate limits with 429 Too Many Requests responses after 10 requests per minute.
8686

8787
```bash
88-
devproxy --config-file rate-limiting.devproxyrc.json
88+
devproxy --config-file .devproxy/rate-limiting.devproxyrc.json
8989
```
9090

9191
Test with:
@@ -99,7 +99,7 @@ curl -ikx http://127.0.0.1:8000 https://api.example.com/data
9999
This configuration adds random latency (3-5 seconds) to all responses.
100100

101101
```bash
102-
devproxy --config-file slow-responses.devproxyrc.json
102+
devproxy --config-file .devproxy/slow-responses.devproxyrc.json
103103
```
104104

105105
Test with:
@@ -123,11 +123,11 @@ This sample demonstrates how to use Dev Proxy to simulate API degradation scenar
123123

124124
| File | Description |
125125
|------|-------------|
126-
| `devproxyrc.json` | Combined configuration with all degradation scenarios |
127-
| `intermittent-errors.devproxyrc.json` | 503 errors at 30% failure rate |
128-
| `rate-limiting.devproxyrc.json` | Rate limiting at 10 requests/minute |
129-
| `slow-responses.devproxyrc.json` | Random latency between 3-5 seconds |
130-
| `errors-503.json` | Error responses for the GenericRandomErrorPlugin |
126+
| `.devproxy/devproxyrc.json` | Combined configuration with all degradation scenarios |
127+
| `.devproxy/intermittent-errors.devproxyrc.json` | 503 errors at 30% failure rate |
128+
| `.devproxy/rate-limiting.devproxyrc.json` | Rate limiting at 10 requests/minute |
129+
| `.devproxy/slow-responses.devproxyrc.json` | Random latency between 3-5 seconds |
130+
| `.devproxy/errors-503.json` | Error responses for the GenericRandomErrorPlugin |
131131
| `index.html` | Monitoring dashboard web app |
132132
| `package.json` | Node.js configuration to run the sample |
133133

samples/api-degradation-scenarios/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Demo web app to test API degradation scenarios with Dev Proxy",
55
"main": "index.html",
66
"scripts": {
7-
"start": "npx concurrently \"npx http-server -p 3000\" \"devproxy\""
7+
"start": "npx concurrently \"npx http-server -p 3000\" \"devproxy --config-file .devproxy/devproxyrc.json\""
88
},
99
"keywords": [
1010
"dev-proxy",

0 commit comments

Comments
 (0)