From cf71ab069a00aa0a3ab7064e7fb08d626af02749 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 17 Aug 2023 12:12:00 +0100 Subject: [PATCH] docs(autofill-credentials): Add warning about hostname and apis A big footgun for me when implementing server.hostname to match my live site was the app stopped working because it was making network requests to the same domain.com/api which Capacitor was routing internally to itself instead. --- docs/main/guides/autofill-credentials.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/main/guides/autofill-credentials.md b/docs/main/guides/autofill-credentials.md index 56d3fe987..add486580 100644 --- a/docs/main/guides/autofill-credentials.md +++ b/docs/main/guides/autofill-credentials.md @@ -89,6 +89,10 @@ const config: CapacitorConfig = { }; ``` +:::note + If you intend to make network requests to an API on the same domain, you must use a subdomain for the API, otherwise your network request will be routed locally to the native app. `api.my-app.com` will work, `my-app.com/api` will not +::: + ## Configuration for iOS ### Configuration in XCode