From c4c9714d413fd0c512e4d32d9ddc3ae092539d14 Mon Sep 17 00:00:00 2001 From: NationsGlory Deploy Date: Thu, 5 Feb 2026 02:03:06 +0100 Subject: [PATCH] fix: utiliser IP hostname au lieu de localhost dans le frontend --- frontend/public/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/public/js/app.js b/frontend/public/js/app.js index 5695734..f282ba6 100644 --- a/frontend/public/js/app.js +++ b/frontend/public/js/app.js @@ -1,5 +1,7 @@ -// Configuration API -const API_URL = 'http://localhost:4001/api'; +// Configuration API - Déterminer l'URL de base +const API_URL = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1' + ? 'http://localhost:4001/api' + : `http://${window.location.hostname}:4001/api`; // State let currentUser = null;