apitrap 1.1.0 → 1.1.1
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/index.js +4 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -307,10 +307,13 @@ class ApiCaptureClient {
|
|
|
307
307
|
const { getBody } = this._patchResponse(res);
|
|
308
308
|
|
|
309
309
|
res.on("finish", () => {
|
|
310
|
+
const routePath = req.route?.path
|
|
311
|
+
? req.baseUrl + req.route.path // → "/api/zone/filterZone/:id/:plantId"
|
|
312
|
+
: req.originalUrl.split("?")[0];
|
|
310
313
|
this.capture({
|
|
311
314
|
routeName,
|
|
312
315
|
menus: menuArray,
|
|
313
|
-
route:
|
|
316
|
+
route: routePath,
|
|
314
317
|
method: req.method,
|
|
315
318
|
desc,
|
|
316
319
|
body: req.body,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apitrap",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Express middleware that captures API traffic and sends it to your monitor dashboard — turn real requests into living API documentation.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|