Set website production url correctly for NGINX

This commit is contained in:
thiloho
2024-09-07 15:07:31 +02:00
parent 958b8e3643
commit 05a15241f6
2 changed files with 8 additions and 3 deletions

View File

@@ -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
};
};