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;