reqly-cli 0.2.0 → 0.2.2

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.
Files changed (2) hide show
  1. package/lib/tunnel.mjs +10 -2
  2. package/package.json +10 -2
package/lib/tunnel.mjs CHANGED
@@ -63,8 +63,16 @@ function printBanner(publicUrl, localUrl, connected) {
63
63
  * Returns { status, headers, body, durationMs }.
64
64
  */
65
65
  async function forwardRequest(localOrigin, capture) {
66
- const { method, path, headers, body } = capture;
67
- const url = `${localOrigin}${path}`;
66
+ const { method, path: rawPath, headers, body } = capture;
67
+ // Strip the /api/bin/SLUG prefix — forward the remainder to localhost
68
+ // e.g. /api/bin/my-slug/webhooks/stripe → /webhooks/stripe
69
+ // e.g. /api/bin/my-slug → /
70
+ let localPath = rawPath || "/";
71
+ const binPrefixMatch = localPath.match(/^\/api\/bin\/[^/]+(\/.*)?$/);
72
+ if (binPrefixMatch) {
73
+ localPath = binPrefixMatch[1] || "/";
74
+ }
75
+ const url = `${localOrigin}${localPath}`;
68
76
 
69
77
  const start = Date.now();
70
78
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reqly-cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Reqly CLI — tunnel webhooks to your local dev server",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,15 @@
14
14
  "engines": {
15
15
  "node": ">=18"
16
16
  },
17
- "keywords": ["api", "tunnel", "webhook", "reqly", "postman", "api-testing", "localhost-tunnel"],
17
+ "keywords": [
18
+ "api",
19
+ "tunnel",
20
+ "webhook",
21
+ "reqly",
22
+ "postman",
23
+ "api-testing",
24
+ "localhost-tunnel"
25
+ ],
18
26
  "author": "Invenit",
19
27
  "license": "MIT",
20
28
  "homepage": "https://req.invenit.dev",