diff options
| author | Frank <[email protected]> | 2025-06-08 01:17:54 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-06-08 01:17:54 -0400 |
| commit | 1d782dc19aa523a8ae81a6c589036291124e8bd9 (patch) | |
| tree | 05d9bf73f1bd4b7c2fe44db3533882ff86cdafab /packages/web/src/pages | |
| parent | 879d02f86c2c45860f064611b643ed1d2af4de0a (diff) | |
| download | opencode-1d782dc19aa523a8ae81a6c589036291124e8bd9.tar.gz opencode-1d782dc19aa523a8ae81a6c589036291124e8bd9.zip | |
Share: load server data on page load
Diffstat (limited to 'packages/web/src/pages')
| -rw-r--r-- | packages/web/src/pages/s/index.astro | 8 |
1 files changed, 7 insertions, 1 deletions
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(); + --- <StarlightPage @@ -15,7 +21,7 @@ import Share from "../../components/Share.tsx"; tableOfContents: false, }} > - <Share api={import.meta.env.VITE_API_URL} client:only="solid" /> + <Share api={apiUrl} data={data.messages} client:only="solid" /> </StarlightPage> <style is:global> |
