mirror of
https://github.com/mudabbir-ahmad/MAD-Treasure-Hunt.git
synced 2026-10-08 03:00:20 +00:00
Refactor API base URL handling for dynamic environment detection; update navigation stack options for improved layout consistency
This commit is contained in:
1 parent
ef514b9c44
commit
5942f8954c
2 files changed
+26
-6
No files matched your search
@@ -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');
|
||||
|
||||
Reference in new issue
Block a user