Skip to content

Commit 5340cd3

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

4 files changed

Lines changed: 9 additions & 11 deletions

File tree

samples/api-usage-analytics/devproxyrc.json renamed to samples/api-usage-analytics/.devproxy/devproxyrc.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
{
55
"name": "ExecutionSummaryPlugin",
66
"enabled": true,
7-
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll",
8-
"configSection": "executionSummaryPlugin"
7+
"pluginPath": "~appFolder/plugins/DevProxy.Plugins.dll"
98
},
109
{
1110
"name": "PlainTextReporter",
@@ -25,9 +24,5 @@
2524
],
2625
"urlsToWatch": [
2726
"https://jsonplaceholder.typicode.com/*"
28-
],
29-
"executionSummaryPlugin": {
30-
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/executionsummaryplugin.schema.json",
31-
"groupBy": "url"
32-
}
27+
]
3328
}

samples/api-usage-analytics/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,18 @@ Using this sample you can use Dev Proxy to:
7777

7878
## Configuration Options
7979

80-
The sample is configured to group requests by URL. You can change this to group by message type by modifying the `groupBy` property in the config file:
80+
The sample is configured to group requests by URL (the default). You can change this to group by message type by modifying the `groupBy` property in the `.devproxy/devproxyrc.json` config file:
8181

8282
```json
8383
"executionSummaryPlugin": {
84+
"$schema": "https://raw.githubusercontent.com/dotnet/dev-proxy/main/schemas/v2.0.0/executionsummaryplugin.schema.json",
8485
"groupBy": "messageType"
8586
}
8687
```
8788

88-
You can also use the command line option: `devproxy --config-file devproxyrc.json --summary-group-by messageType`
89+
Don't forget to add a `configSection` reference to the ExecutionSummaryPlugin when adding custom configuration.
90+
91+
You can also use the command line option: `devproxy --summary-group-by messageType`
8992

9093
To monitor different APIs, update the `urlsToWatch` property:
9194

samples/api-usage-analytics/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h1>🔍 API Usage Analytics</h1>
150150
<div class="instructions">
151151
<h3>📋 How to use</h3>
152152
<ol>
153-
<li>Start Dev Proxy: <code>devproxy --config-file devproxyrc.json</code></li>
153+
<li>Start Dev Proxy: <code>devproxy</code></li>
154154
<li>Configure your browser to use <code>http://127.0.0.1:8000</code> as proxy</li>
155155
<li>Open this page and click the API buttons to make requests</li>
156156
<li>Stop Dev Proxy (<kbd>Ctrl</kbd>+<kbd>C</kbd>) to see the execution summary</li>

samples/api-usage-analytics/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "Track API usage analytics with Dev Proxy",
55
"scripts": {
6-
"start": "concurrently -n server,proxy -c cyan,magenta \"http-server -p 3000\" \"devproxy --config-file devproxyrc.json\""
6+
"start": "concurrently -n server,proxy -c cyan,magenta \"http-server -p 3000\" \"devproxy\""
77
},
88
"devDependencies": {
99
"concurrently": "^9.1.2",

0 commit comments

Comments
 (0)