mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 19:01:35 +01:00
Set website production url correctly for NGINX
This commit is contained in:
@@ -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
|
||||
};
|
||||
};
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
|
||||
const { data, form }: { data: PageServerData; form: ActionData } = $props();
|
||||
|
||||
const prodWebsiteUrl = data.websitePreviewUrl.replace("/previews", "");
|
||||
|
||||
let sending = $state(false);
|
||||
</script>
|
||||
|
||||
@@ -56,7 +54,7 @@
|
||||
<p>
|
||||
Your website is published at:
|
||||
<br />
|
||||
<a href={prodWebsiteUrl}>{prodWebsiteUrl}</a>
|
||||
<a href={data.websiteProdUrl}>{data.websiteProdUrl}</a>
|
||||
</p>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user