From f8e9443ef83ac06d963f067d7ed66b859fb16114 Mon Sep 17 00:00:00 2001 From: Morgan Wattiez Date: Sat, 24 May 2025 23:58:06 +0200 Subject: [PATCH] fix: use relative URL for API calls instead of localhost --- VERSION | 2 +- public/index.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 4e379d2..bcab45a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.2 +0.0.3 diff --git a/public/index.html b/public/index.html index fd12dd1..60df297 100644 --- a/public/index.html +++ b/public/index.html @@ -49,7 +49,8 @@ filmsDiv.innerHTML = '

Recherche en cours...

'; try { - const response = await fetch(`http://localhost:3000/search?q=${encodeURIComponent(query)}`); + const base = window.location.origin; + const response = await fetch(`${base}/search?q=${encodeURIComponent(query)}`); if (!response.ok) { // Gilfoyle: "The network, or your server, is garbage." filmsDiv.innerHTML = `

Erreur: ${response.status} ${response.statusText || 'Impossible de joindre le backend.'}

`;