Refactor API base URL handling for dynamic environment detection; update navigation stacks and integrate SafeAreaProvider for improved layout management across screens.

This commit is contained in:
bobbert committed 2026-04-06 01:12:36 +01:00
1 parent 8acf4c923a
commit d7bc5d38d1
18 files changed
+806 -166

No files matched your search

+15 -1
View File
@@ -1,4 +1,18 @@
export const API_BASE_URL = 'http://localhost:3000';
import Constants from 'expo-constants';
const getBaseUrl = () => {
// In Expo Go the debuggerHost is "192.168.x.x:8081" — grab the IP
const debuggerHost = Constants.expoGoConfig?.debuggerHost;
if (debuggerHost) {
const ip = debuggerHost.split(':')[0];
return `http://${ip}:3000`;
}
// Fallback for web / production
return 'http://localhost:3000';
};
export const API_BASE_URL = getBaseUrl();
//export const API_BASE_URL = 'http://api.bobby.ip-ddns.com'; // Production server URL
const API = {};