From 9e545bd7f3091e5b23edafef6a8ff84ca5c19d45 Mon Sep 17 00:00:00 2001 From: Thibaud Moustier Date: Fri, 27 Feb 2026 23:00:03 +0100 Subject: [PATCH] "Mobile : Modification en.ts - refractor --- Wallette/mobile/src/config/env.ts | 38 +------------------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/Wallette/mobile/src/config/env.ts b/Wallette/mobile/src/config/env.ts index e394a9b..57d42e8 100644 --- a/Wallette/mobile/src/config/env.ts +++ b/Wallette/mobile/src/config/env.ts @@ -1,37 +1 @@ -import { Platform } from "react-native"; - -/** - * env.ts - * ------ - * Objectif : centraliser les URLs réseau pour le mobile. - * - * IMPORTANT (microservices + gateway) : - * - Le mobile parle UNIQUEMENT au gateway : http://:3000 - * - REST = http://:3000/api/... - * - Socket.IO = http://:3000 (proxy /socket.io/* via gateway) - * - * Téléphone physique : - * - = IP du PC sur le Wi-Fi (ex: 192.168.x.x) - * - * Émulateurs (si un jour) : - * - Android: 10.0.2.2 - * - iOS: localhost - */ - -const DEV_LAN_IP = "192.168.129.121"; - -function resolveHost(): string { - // On part sur téléphone physique (ton cas). - // Si un jour tu testes sur émulateur Android, tu peux mettre une condition: - // if (Platform.OS === "android" && __DEV__ && isEmulator) return "10.0.2.2"; - return DEV_LAN_IP; -} - -// Base gateway (HTTP) -export const GATEWAY_BASE_URL = `http://${resolveHost()}:3000`; - -// REST (via gateway) -export const API_BASE_URL = `${GATEWAY_BASE_URL}/api`; - -// Socket.IO (via gateway) -export const SERVER_URL = GATEWAY_BASE_URL; \ No newline at end of file +const DEV_LAN_IP = "192.168.129.121"; \ No newline at end of file -- 2.50.1