2 Commits

Author SHA1 Message Date
f8e9443ef8 fix: use relative URL for API calls instead of localhost 2025-05-24 23:58:06 +02:00
8762f28b27 fix healthcheck 2025-05-24 23:54:09 +02:00
3 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@
"changelog": "file://CHANGELOG.md",
"tagline": "Ciné-agrégateur multi-source pour enfants.",
"version": "1.0.0",
"healthCheckPath": "/search?q=test",
"healthCheckPath": "/search",
"httpPort": 3000,
"addons": {
"localstorage": {}

View File

@ -1 +1 @@
0.0.1
0.0.3

View File

@ -49,7 +49,8 @@
filmsDiv.innerHTML = '<p class="loader">Recherche en cours...</p>';
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 = `<p class="no-results">Erreur: ${response.status} ${response.statusText || 'Impossible de joindre le backend.'}</p>`;