Spaces:
Sleeping
Sleeping
Download apps/web/src/bildUrl.ts from Bryan-HSLU/FP_POC: direct link, hf CLI and curl.
- Browser
- Download file 655 Bytes
-
https://huggingface.co/spaces/Bryan-HSLU/FP_POC/resolve/main/apps/web/src/bildUrl.ts
- Command line
-
hf download hf://spaces/Bryan-HSLU/FP_POC/apps/web/src/bildUrl.ts
-
curl -L -o bildUrl.ts https://huggingface.co/spaces/Bryan-HSLU/FP_POC/resolve/main/apps/web/src/bildUrl.ts
655 Bytes
| /** Baut die URL zu einem Swipe-/Preset-Foto. | |
| * | |
| * Die Bilder werden nicht mehr über das Python-Backend (`/api/bilder/...`) | |
| * ausgeliefert, sondern als statische Dateien direkt aus dem Frontend-Build | |
| * unter `/bilder/...` (siehe `fpBilder()`-Plugin in vite.config.ts) – Grund: | |
| * CDN-Auslieferung, der Vercel-Proxy leitet nur `/api/*` ans Backend weiter. | |
| */ | |
| /** `bildRef` kann Unterordner enthalten (z. B. "bad/Bild Nasszelle (1).jpg"); | |
| * jedes Pfadsegment wird einzeln kodiert, der Schrägstrich bleibt Trenner. */ | |
| export function bildUrl(bildRef: string): string { | |
| return "/bilder/" + bildRef.split("/").map(encodeURIComponent).join("/"); | |
| } | |