You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds inspector config option table to Configuration Options and a new
Request Inspector section covering the web UI, source badges (P/C/L),
DevTools console banner, REST API endpoints, and configuration example.
|`enabled`|`boolean`|`true`| Enable the request inspector |
183
+
|`maxMemory`|`number`|`104857600`| Max total body memory (bytes) before oldest entries are evicted (default 100 MB) |
184
+
|`captureLimit`|`number`|`10485760`| Max body size captured per request/response (bytes, default 10 MB). Larger bodies are stored truncated. |
185
+
178
186
### `sync` — Template sync
179
187
180
188
| Field | Type | Default | Description |
@@ -380,6 +388,68 @@ module.exports = withPPDev({
380
388
381
389
For custom build configuration, create a `vite.config` file. See [Vite Configuration](https://vitejs.dev/config/) for details.
382
390
391
+
## Request Inspector
392
+
393
+
pp-dev includes a built-in request inspector that captures every proxied and locally-served HTTP request made during development. It is enabled by default.
394
+
395
+
### Web UI
396
+
397
+
Open `http://localhost:3000/@pp-dev/inspector` (replace port as needed) in any browser tab while the dev server is running. The UI shows:
398
+
399
+
- A scrollable list of captured requests with method, status, source badge, and timing
400
+
- Full request and response headers, with a **Copy** button per section
401
+
- Request and response bodies rendered as text for JSON/HTML/CSS/plain-text content types, with **Copy** and **Save** buttons
402
+
- Binary bodies (images, fonts, archives) show metadata only and offer a **Save** button
403
+
- A **Clear** button in the top-right removes all stored entries
404
+
405
+
### Source badges
406
+
407
+
Each request in the list displays a colored letter badge to the left of the HTTP status:
|`GET`|`/@api/requests`| Paginated list of captured requests (metadata only, no bodies) |
432
+
|`GET`|`/@api/requests/:id`| Full entry including captured request/response bodies (base64-encoded) |
433
+
|`GET`|`/@api/requests/stats`| Store stats: entry count, memory usage, limits |
434
+
|`DELETE`|`/@api/requests`| Clear all stored entries |
435
+
436
+
`GET /@api/requests` accepts `?limit=` (default 50) and `?offset=` query parameters for pagination.
437
+
438
+
Bodies in `GET /@api/requests/:id` are returned as base64 strings in `requestBody` / `responseBody` fields alongside `requestContentType` / `responseContentType`. A `*Truncated: true` flag indicates the body exceeded `captureLimit` and was cut off.
439
+
440
+
### Configuration
441
+
442
+
```typescript
443
+
// pp-dev.config.ts
444
+
exportdefaultdefineConfig({
445
+
inspector: {
446
+
enabled: true, // set to false to disable entirely
0 commit comments