From d22673ca9569eea00f90575de0a16284358ac961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksa=20Siri=C5=A1ki?= <31509435+aleksasiriski@users.noreply.github.com> Date: Thu, 21 Mar 2024 23:11:36 +0100 Subject: [PATCH] feat(images): proxy (#168) --- .env.example | 4 ++++ .../search/display/images/Image.svelte | 4 +++- .../search/display/images/Preview.svelte | 4 +++- src/lib/functions/createPublicApiUrl.ts | 10 ++++++++++ src/lib/functions/proxyImageLink.ts | 16 ++++++++++++++++ src/lib/types/result.ts | 2 ++ 6 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/lib/functions/createPublicApiUrl.ts create mode 100644 src/lib/functions/proxyImageLink.ts diff --git a/.env.example b/.env.example index 437a22d8..30a6d3b4 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,5 @@ API_URI=http://localhost:3030 # server reachable +PUBLIC_API_URI=http://localhost:3030 # client reachable +# use local frontend with official backend (CORS is enabled for http://localhost:5173) +# API_URI=https://api.hearch.co +# PUBLIC_API_URI=https://api.hearch.co diff --git a/src/lib/components/search/display/images/Image.svelte b/src/lib/components/search/display/images/Image.svelte index 3be4f2f3..38bf8458 100644 --- a/src/lib/components/search/display/images/Image.svelte +++ b/src/lib/components/search/display/images/Image.svelte @@ -1,4 +1,6 @@