Refactor API base URL handling for dynamic environment detection; update navigation stack options for improved layout consistency

This commit is contained in:
bobbert committed 2026-04-06 02:13:35 +01:00
1 parent ef514b9c44
commit 5942f8954c
2 files changed
+26 -6

No files matched your search

+9 -2
View File
@@ -1,5 +1,12 @@
//export const API_BASE_URL = 'http://192.168.8.100:3000';
export const API_BASE_URL = 'http://api.bobby.ip-ddns.com';
import Constants from 'expo-constants';
const getBaseUrl = () => {
const host = Constants.expoGoConfig?.debuggerHost;
if (host) return `http://${host.split(':')[0]}:3000`;
return 'http://api.bobby.ip-ddns.com';
};
export const API_BASE_URL = getBaseUrl();
const API = {};
API.get = (endpoint) => callFetch(endpoint, 'GET');