--- export const prerender = false; import PageLayout from "@/layouts/Base.astro"; import WineCard from "@/components/page/WineCard.astro"; const meta = { title: "/cellar", description: "My wine tasting log", }; const CELLAR_API_URL = import.meta.env.CELLAR_API_URL ?? "https://cellar.stevedylan.dev"; let wines: any[] = []; let error: string | null = null; try { const res = await fetch(`${CELLAR_API_URL}/api/wines`); if (res.ok) { wines = await res.json(); } else { error = `API returned ${res.status}`; } } catch (e) { error = e instanceof Error ? e.message : "Failed to reach cellar API"; } ---

/cellar

{error ? (

Could not load wines: {error}

) : wines.length === 0 ? (

no wines yet

) : (
{wines.map((wine: any) => ( ))}
)}