From 2c0d4254cae64bb67c9d58179ef8a6693b5c4e4c Mon Sep 17 00:00:00 2001 From: Linus Waldowsky Date: Sun, 4 Jan 2026 17:48:39 +0100 Subject: [PATCH] fix API base URL for Android emulator --- apps/client/src/services/ApiClient.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/client/src/services/ApiClient.ts b/apps/client/src/services/ApiClient.ts index 8628f45..26c8b01 100644 --- a/apps/client/src/services/ApiClient.ts +++ b/apps/client/src/services/ApiClient.ts @@ -1,5 +1,11 @@ +import { Platform } from "react-native"; + 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";