fix API base URL for Android emulator

This commit is contained in:
2026-01-04 17:48:39 +01:00
parent 7c081787fe
commit 2c0d4254ca

View File

@@ -1,5 +1,11 @@
import { Platform } from "react-native";
const API_BASE_URL = const API_BASE_URL =
process.env.EXPO_PUBLIC_API_URL || "http://localhost:3001/api"; process.env.EXPO_PUBLIC_API_URL ||
Platform.select({
android: "http://10.0.2.2:3001/api",
default: "http://localhost:3001/api",
});
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE"; type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";