devlinker 1.2.7__tar.gz → 1.3.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devlinker
3
- Version: 1.2.7
3
+ Version: 1.3.0
4
4
  Summary: AI-powered linking and automation tool
5
5
  Author-email: Mani <mani1028@users.noreply.github.com>
6
6
  Requires-Python: >=3.7
@@ -259,6 +259,34 @@ The test spins up lightweight local frontend and backend apps, starts Dev Linker
259
259
  - `POST /api/login` is routed to backend
260
260
  - `ws://.../hmr` round-trip works through proxy
261
261
 
262
+ ## Troubleshooting Links
263
+
264
+ If local or shared links show blank pages, connection refused errors, or 404s, check these common causes:
265
+
266
+ 1. Docker backend binding
267
+
268
+ - Symptom: `http://localhost:<backend-port>` refuses connection.
269
+ - Cause: backend process inside container is bound to `127.0.0.1` instead of `0.0.0.0`.
270
+ - Fix: run backend with host `0.0.0.0` (example FastAPI/Uvicorn: `uvicorn app.main:app --host 0.0.0.0 --port 8000`).
271
+
272
+ 2. API prefix mismatch
273
+
274
+ - Symptom: frontend loads through Dev Linker but API calls return 404.
275
+ - Cause: frontend calls `/api/...`, but backend routes are mounted without `/api` prefix.
276
+ - Fix: expose backend routes under `/api` (or adjust frontend paths to match backend routes).
277
+
278
+ 3. Vite host restrictions
279
+
280
+ - Symptom: direct Vite URL works, Dev Linker proxy URL is blank or blocked.
281
+ - Cause: Vite host protections reject proxied host/port.
282
+ - Fix: set Vite `server.host` and `server.allowedHosts` to allow proxy use.
283
+
284
+ Quick isolate sequence:
285
+
286
+ 1. Open `http://localhost:<backend-port>/docs` (or `/health`) directly.
287
+ 2. Open Dev Linker local proxy URL and verify UI loads.
288
+ 3. Use browser network tab to check API status codes for `/api/*` requests.
289
+
262
290
  ## Real-Time Development
263
291
 
264
292
  - Run `devlinker` to share one combined frontend/backend URL.
@@ -243,6 +243,34 @@ The test spins up lightweight local frontend and backend apps, starts Dev Linker
243
243
  - `POST /api/login` is routed to backend
244
244
  - `ws://.../hmr` round-trip works through proxy
245
245
 
246
+ ## Troubleshooting Links
247
+
248
+ If local or shared links show blank pages, connection refused errors, or 404s, check these common causes:
249
+
250
+ 1. Docker backend binding
251
+
252
+ - Symptom: `http://localhost:<backend-port>` refuses connection.
253
+ - Cause: backend process inside container is bound to `127.0.0.1` instead of `0.0.0.0`.
254
+ - Fix: run backend with host `0.0.0.0` (example FastAPI/Uvicorn: `uvicorn app.main:app --host 0.0.0.0 --port 8000`).
255
+
256
+ 2. API prefix mismatch
257
+
258
+ - Symptom: frontend loads through Dev Linker but API calls return 404.
259
+ - Cause: frontend calls `/api/...`, but backend routes are mounted without `/api` prefix.
260
+ - Fix: expose backend routes under `/api` (or adjust frontend paths to match backend routes).
261
+
262
+ 3. Vite host restrictions
263
+
264
+ - Symptom: direct Vite URL works, Dev Linker proxy URL is blank or blocked.
265
+ - Cause: Vite host protections reject proxied host/port.
266
+ - Fix: set Vite `server.host` and `server.allowedHosts` to allow proxy use.
267
+
268
+ Quick isolate sequence:
269
+
270
+ 1. Open `http://localhost:<backend-port>/docs` (or `/health`) directly.
271
+ 2. Open Dev Linker local proxy URL and verify UI loads.
272
+ 3. Use browser network tab to check API status codes for `/api/*` requests.
273
+
246
274
  ## Real-Time Development
247
275
 
248
276
  - Run `devlinker` to share one combined frontend/backend URL.
@@ -6,15 +6,50 @@ from typing import Iterable, Optional, Tuple
6
6
  import requests
7
7
 
8
8
 
9
- def check_port(port: int, timeout: float = 1.0) -> bool:
10
- """Return True when an HTTP service responds on localhost:port."""
9
+ DEFAULT_BACKEND_PROBE_PATHS = (
10
+ "/health",
11
+ "/api/health",
12
+ "/",
13
+ )
14
+
15
+
16
+ def check_port(
17
+ port: int,
18
+ timeout: float = 1.0,
19
+ probe_paths: Iterable[str] = DEFAULT_BACKEND_PROBE_PATHS,
20
+ ) -> bool:
21
+ """Return True when an HTTP service is reachable on localhost:port.
22
+
23
+ Probe order is health-first (for API-style backends), then root fallback.
24
+ """
25
+ normalized_paths: list[str] = []
26
+ for path in probe_paths:
27
+ cleaned = path.strip()
28
+ if not cleaned:
29
+ continue
30
+ if not cleaned.startswith("/"):
31
+ cleaned = f"/{cleaned}"
32
+ normalized_paths.append(cleaned)
33
+
34
+ if not normalized_paths:
35
+ normalized_paths = ["/"]
36
+
11
37
  for host in ("localhost", "127.0.0.1"):
12
- try:
13
- response = requests.get(f"http://{host}:{port}", timeout=timeout)
14
- if response.status_code < 500:
38
+ for path in normalized_paths:
39
+ try:
40
+ response = requests.get(f"http://{host}:{port}{path}", timeout=timeout)
41
+ except requests.RequestException:
42
+ continue
43
+
44
+ # Health endpoints must return 2xx/3xx to be considered ready.
45
+ if path in {"/health", "/api/health"}:
46
+ if 200 <= response.status_code < 400:
47
+ return True
48
+ continue
49
+
50
+ # Root fallback accepts non-error responses.
51
+ if 200 <= response.status_code < 400:
15
52
  return True
16
- except requests.RequestException:
17
- pass
18
53
  return False
19
54
 
20
55
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devlinker
3
- Version: 1.2.7
3
+ Version: 1.3.0
4
4
  Summary: AI-powered linking and automation tool
5
5
  Author-email: Mani <mani1028@users.noreply.github.com>
6
6
  Requires-Python: >=3.7
@@ -259,6 +259,34 @@ The test spins up lightweight local frontend and backend apps, starts Dev Linker
259
259
  - `POST /api/login` is routed to backend
260
260
  - `ws://.../hmr` round-trip works through proxy
261
261
 
262
+ ## Troubleshooting Links
263
+
264
+ If local or shared links show blank pages, connection refused errors, or 404s, check these common causes:
265
+
266
+ 1. Docker backend binding
267
+
268
+ - Symptom: `http://localhost:<backend-port>` refuses connection.
269
+ - Cause: backend process inside container is bound to `127.0.0.1` instead of `0.0.0.0`.
270
+ - Fix: run backend with host `0.0.0.0` (example FastAPI/Uvicorn: `uvicorn app.main:app --host 0.0.0.0 --port 8000`).
271
+
272
+ 2. API prefix mismatch
273
+
274
+ - Symptom: frontend loads through Dev Linker but API calls return 404.
275
+ - Cause: frontend calls `/api/...`, but backend routes are mounted without `/api` prefix.
276
+ - Fix: expose backend routes under `/api` (or adjust frontend paths to match backend routes).
277
+
278
+ 3. Vite host restrictions
279
+
280
+ - Symptom: direct Vite URL works, Dev Linker proxy URL is blank or blocked.
281
+ - Cause: Vite host protections reject proxied host/port.
282
+ - Fix: set Vite `server.host` and `server.allowedHosts` to allow proxy use.
283
+
284
+ Quick isolate sequence:
285
+
286
+ 1. Open `http://localhost:<backend-port>/docs` (or `/health`) directly.
287
+ 2. Open Dev Linker local proxy URL and verify UI loads.
288
+ 3. Use browser network tab to check API status codes for `/api/*` requests.
289
+
262
290
  ## Real-Time Development
263
291
 
264
292
  - Run `devlinker` to share one combined frontend/backend URL.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devlinker"
7
- version = "1.2.7"
7
+ version = "1.3.0"
8
8
  description = "AI-powered linking and automation tool"
9
9
  authors = [
10
10
  { name = "Mani", email = "mani1028@users.noreply.github.com" }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes