From 1d782dc19aa523a8ae81a6c589036291124e8bd9 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 8 Jun 2025 01:17:54 -0400 Subject: Share: load server data on page load --- packages/web/src/pages/s/index.astro | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'packages/web/src/pages') diff --git a/packages/web/src/pages/s/index.astro b/packages/web/src/pages/s/index.astro index b678c0db9..e4c5c5df3 100644 --- a/packages/web/src/pages/s/index.astro +++ b/packages/web/src/pages/s/index.astro @@ -4,6 +4,12 @@ import config from "virtual:starlight/user-config"; import StarlightPage from '@astrojs/starlight/components/StarlightPage.astro'; import Share from "../../components/Share.tsx"; +const apiUrl = import.meta.env.VITE_API_URL; + +const id = Astro.url.searchParams.get('id') +const res = await fetch(`${apiUrl}/share_messages?id=${id}`); +const data = await res.json(); + --- - +