diff --git a/web/src/routes/+page.svelte b/web/src/routes/+page.svelte index 207f321..68468df 100644 --- a/web/src/routes/+page.svelte +++ b/web/src/routes/+page.svelte @@ -13,6 +13,8 @@ let selectedImage = 0; const debounceDelay = 300; + const apiEndpoint = + typeof PUBLIC_API_ENDPOINT !== 'undefined' ? PUBLIC_API_ENDPOINT : window.location.origin; /** * @param {string} query @@ -21,7 +23,6 @@ isLoading = true; try { - const apiEndpoint = typeof PUBLIC_API_ENDPOINT !== 'undefined' ? PUBLIC_API_ENDPOINT : window.location.origin; const response = await fetch(`${apiEndpoint}/search?q=${encodeURIComponent(query)}`); if (!response.ok) { throw new Error('Network response was not ok'); @@ -141,7 +142,7 @@ {#if searchResults.length && showModal}