@@ -3,24 +3,28 @@ import "../styles/techapi.css";
33
44const raw = import .meta .env .BASE_URL ;
55const base = raw .endsWith (" /" ) ? raw : raw + " /" ;
6+ // Data links only: PUBLIC_API_BASE_URL (e.g. a Vercel preview reading main's live data)
7+ // takes over just these, while site nav/assets below keep using `base`.
8+ const apiRaw = import .meta .env .PUBLIC_API_BASE_URL || raw ;
9+ const apiBase = apiRaw .endsWith (" /" ) ? apiRaw : apiRaw + " /" ;
610const ghUrl = " https://github.com/GetTechAPI/TechAPI" ;
711const engineUrl = " https://github.com/GetTechAPI/TechEngine" ;
812
913const endpoints = [
10- { label: " /v1/smartphones" , desc: " List all phones" , href: ` ${base }v1/smartphones/index.json ` },
11- { label: " /v1/smartphones/{slug}" , desc: " Phone detail + scores" , href: ` ${base }v1/smartphones/galaxy-s26-ultra/index.json ` },
12- { label: " /v1/smartphones/{slug}/score" , desc: " Computed scores" , href: ` ${base }v1/smartphones/galaxy-s26-ultra/score/index.json ` },
13- { label: " /v1/tablets" , desc: " List all tablets" , href: ` ${base }v1/tablets/index.json ` },
14- { label: " /v1/laptops" , desc: " List all laptops" , href: ` ${base }v1/laptops/index.json ` },
15- { label: " /v1/monitors" , desc: " List all monitors" , href: ` ${base }v1/monitors/index.json ` },
16- { label: " /v1/watches" , desc: " List all watches" , href: ` ${base }v1/watches/index.json ` },
17- { label: " /v1/pdas" , desc: " List all PDAs" , href: ` ${base }v1/pdas/index.json ` },
18- { label: " /v1/socs/{slug}" , desc: " System-on-chip detail" , href: ` ${base }v1/socs/snapdragon-8-elite-gen-5/index.json ` },
19- { label: " /v1/gpus/{slug}" , desc: " Discrete GPU detail" , href: ` ${base }v1/gpus/geforce-rtx-5090/index.json ` },
20- { label: " /v1/cpus/{slug}" , desc: " Desktop / laptop CPU" , href: ` ${base }v1/cpus/core-i9-14900k/index.json ` },
21- { label: " /v1/software" , desc: " List all software" , href: ` ${base }v1/software/index.json ` },
22- { label: " /v1/websites" , desc: " List all websites" , href: ` ${base }v1/websites/index.json ` },
23- { label: " /v1/brands" , desc: " All brands" , href: ` ${base }v1/brands/index.json ` },
14+ { label: " /v1/smartphones" , desc: " List all phones" , href: ` ${apiBase }v1/smartphones/index.json ` },
15+ { label: " /v1/smartphones/{slug}" , desc: " Phone detail + scores" , href: ` ${apiBase }v1/smartphones/galaxy-s26-ultra/index.json ` },
16+ { label: " /v1/smartphones/{slug}/score" , desc: " Computed scores" , href: ` ${apiBase }v1/smartphones/galaxy-s26-ultra/score/index.json ` },
17+ { label: " /v1/tablets" , desc: " List all tablets" , href: ` ${apiBase }v1/tablets/index.json ` },
18+ { label: " /v1/laptops" , desc: " List all laptops" , href: ` ${apiBase }v1/laptops/index.json ` },
19+ { label: " /v1/monitors" , desc: " List all monitors" , href: ` ${apiBase }v1/monitors/index.json ` },
20+ { label: " /v1/watches" , desc: " List all watches" , href: ` ${apiBase }v1/watches/index.json ` },
21+ { label: " /v1/pdas" , desc: " List all PDAs" , href: ` ${apiBase }v1/pdas/index.json ` },
22+ { label: " /v1/socs/{slug}" , desc: " System-on-chip detail" , href: ` ${apiBase }v1/socs/snapdragon-8-elite-gen-5/index.json ` },
23+ { label: " /v1/gpus/{slug}" , desc: " Discrete GPU detail" , href: ` ${apiBase }v1/gpus/geforce-rtx-5090/index.json ` },
24+ { label: " /v1/cpus/{slug}" , desc: " Desktop / laptop CPU" , href: ` ${apiBase }v1/cpus/core-i9-14900k/index.json ` },
25+ { label: " /v1/software" , desc: " List all software" , href: ` ${apiBase }v1/software/index.json ` },
26+ { label: " /v1/websites" , desc: " List all websites" , href: ` ${apiBase }v1/websites/index.json ` },
27+ { label: " /v1/brands" , desc: " All brands" , href: ` ${apiBase }v1/brands/index.json ` },
2428];
2529---
2630
0 commit comments