fix: utiliser IP hostname au lieu de localhost dans le frontend

This commit is contained in:
2026-02-05 02:03:06 +01:00
parent ba48c760c5
commit c4c9714d41

View File

@@ -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;