feat: 添加.env.local配置
This commit is contained in:
@@ -101,11 +101,11 @@ app.get('/health', (req, res) => {
|
||||
app.listen(PORT, () => {
|
||||
console.log(`
|
||||
╔════════════════════════════════════════════════════════╗
|
||||
║ 🚀 Proxy Server Running ║
|
||||
║ Proxy Server Running ║
|
||||
╠════════════════════════════════════════════════════════╣
|
||||
║ Local: http://localhost:${PORT} ║
|
||||
║ Target: ${API_TARGET.padEnd(40)} ║
|
||||
║ Health: http://localhost:${PORT}/health ║
|
||||
║ Local: http://localhost:${PORT} ║
|
||||
║ Target: ${API_TARGET.padEnd(40)} ║
|
||||
║ Health: http://localhost:${PORT}/health ║
|
||||
╚════════════════════════════════════════════════════════╝
|
||||
`);
|
||||
});
|
||||
|
||||
@@ -51,12 +51,9 @@ export const getApiBaseUrl = (): string => {
|
||||
return 'http://localhost:8086/api';
|
||||
} else {
|
||||
// iOS/Android 使用本机 IP
|
||||
// ⚠️ 重要:需要替换为你的本机 IP 地址
|
||||
// 查看本机 IP:
|
||||
// - Windows: ipconfig
|
||||
// - Mac/Linux: ifconfig
|
||||
// - 或者使用 Metro Bundler 显示的 IP
|
||||
return 'http://192.168.1.100:8086/api';
|
||||
// 从环境变量读取,避免多人开发时地址冲突
|
||||
// 请在 .env.local 文件中配置 EXPO_PUBLIC_DEV_API_URL
|
||||
return process.env.EXPO_PUBLIC_DEV_API_URL || 'http://192.168.1.100:8086/api';
|
||||
}
|
||||
|
||||
case 'staging':
|
||||
|
||||
Reference in New Issue
Block a user