mirror of
https://github.com/mudabbir-ahmad/MAD-Treasure-Hunt.git
synced 2026-10-07 19:00:20 +00:00
Update API base URL to production server; remove dynamic URL handling for cleaner configuration
This commit is contained in:
1 parent
d7bc5d38d1
commit
ef514b9c44
1 file changed
+2
-16
@@ -1,19 +1,5 @@
|
||||
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
|
||||
|
||||
//export const API_BASE_URL = 'http://192.168.8.100:3000';
|
||||
export const API_BASE_URL = 'http://api.bobby.ip-ddns.com';
|
||||
const API = {};
|
||||
|
||||
API.get = (endpoint) => callFetch(endpoint, 'GET');
|
||||
|
||||
Reference in new issue
Block a user