更新API地址
This commit is contained in:
@@ -1,6 +1,16 @@
|
|||||||
|
const getApiBaseUrl = (): string => {
|
||||||
|
if (__DEV__) {
|
||||||
|
return process.env.EXPO_PUBLIC_API_BASE_URL || "http://192.168.1.111:8000";
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
process.env.EXPO_PUBLIC_API_BASE_URL || "https://football.ambigrat.com/"
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export const API_CONFIG = {
|
export const API_CONFIG = {
|
||||||
BASE_URL: "http://192.168.1.111:8000", // Update this with your machine IP if running on device ex: http://192.168.1.5:8000
|
BASE_URL: getApiBaseUrl(),
|
||||||
TIMEOUT: 100000,
|
TIMEOUT: 10000,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const API_ENDPOINTS = {
|
export const API_ENDPOINTS = {
|
||||||
|
|||||||
24
eas.json
24
eas.json
@@ -7,26 +7,50 @@
|
|||||||
"development": {
|
"development": {
|
||||||
"developmentClient": true,
|
"developmentClient": true,
|
||||||
"distribution": "internal",
|
"distribution": "internal",
|
||||||
|
"env": {
|
||||||
|
"EXPO_PUBLIC_API_BASE_URL": "http://192.168.1.111:8000"
|
||||||
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"env": {
|
"env": {
|
||||||
"EAS_BUILD_DISABLE_MAVEN_CACHE": "1"
|
"EAS_BUILD_DISABLE_MAVEN_CACHE": "1"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"env": {
|
||||||
|
"EXPO_PUBLIC_API_BASE_URL": "http://192.168.1.111:8000"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"preview": {
|
"preview": {
|
||||||
"distribution": "internal",
|
"distribution": "internal",
|
||||||
|
"env": {
|
||||||
|
"EXPO_PUBLIC_API_BASE_URL": "https://football.ambigrat.com/"
|
||||||
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"env": {
|
"env": {
|
||||||
"EAS_BUILD_DISABLE_MAVEN_CACHE": "1"
|
"EAS_BUILD_DISABLE_MAVEN_CACHE": "1"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"env": {
|
||||||
|
"EXPO_PUBLIC_API_BASE_URL": "https://football.ambigrat.com/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"production": {
|
"production": {
|
||||||
"autoIncrement": true,
|
"autoIncrement": true,
|
||||||
|
"env": {
|
||||||
|
"EXPO_PUBLIC_API_BASE_URL": "https://football.ambigrat.com/"
|
||||||
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"env": {
|
"env": {
|
||||||
"EAS_BUILD_DISABLE_MAVEN_CACHE": "1"
|
"EAS_BUILD_DISABLE_MAVEN_CACHE": "1"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"env": {
|
||||||
|
"EXPO_PUBLIC_API_BASE_URL": "https://football.ambigrat.com/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user