fix API base URL for Android emulator
This commit is contained in:
@@ -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";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user