diff --git a/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.server.ts b/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.server.ts index cf10721..c7499ad 100644 --- a/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.server.ts +++ b/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.server.ts @@ -60,9 +60,16 @@ export const load: PageServerLoad = async ({ params, fetch, cookies, parent }) = : "http://localhost:18000" }/previews/${websiteOverview.id}/index.html`; + const websiteProdUrl = dev + ? `http://localhost:18000/${websiteOverview.id}/index.html` + : process.env.ORIGIN + ? process.env.ORIGIN.replace("//", `//${websiteOverview.id}.`) + : `http://localhost:18000/${websiteOverview.id}/index.html`; + return { websiteOverview, websitePreviewUrl, + websiteProdUrl, website }; }; diff --git a/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.svelte b/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.svelte index 83ffd9b..eaf69dd 100644 --- a/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.svelte +++ b/web-app/src/routes/(authenticated)/website/[websiteId]/publish/+page.svelte @@ -7,8 +7,6 @@ const { data, form }: { data: PageServerData; form: ActionData } = $props(); - const prodWebsiteUrl = data.websitePreviewUrl.replace("/previews", ""); - let sending = $state(false); @@ -56,7 +54,7 @@

Your website is published at:
- {prodWebsiteUrl} + {data.websiteProdUrl}

{/if}