SPA will not call my api running on localhost when executed via the android emulator

I wasn’t aware of the chrome developer tools to see more info, I will see what I can find there.

Having the server with your API also serve out an index.html makes it so your spa doesn’t have to deal with CORS issues in browser, which is really nice. It is also a very simple implementation, simplifying our single sign on with our organization’s identity provider. It also keeps our SPA simple because it fetches relative to wherever it is hosted, so we don’t have to change our API url for our test, or stage lanes. Whether it’s highly unusual or not doesn’t change our reasons for it being built that way.

localhost:5001 is just where the SPA is running when developers run locally. Our SPA doesn’t know, doesn’t care though. It just does the fetch to “api/weather/90210”. During local development that is localhost:5001/api/weather/90210. When we deploy to test and create a capacitor build for test it would fetch to something like ourweather-test.company.org/api/weather/90210. Then some day we would conceivably release a capacitor app that works against a prod lane at something like ourweather.company.org/api/weather/90210. That works beautifully and simply for our SPA in browser and all of our fetch calls are relative, meaning they don’t need code nor configuration for each deployed lane.

If we have to rewrite and rearchitect how our SPA talks to an API in order to use capacitor, that is a pretty big downside for our apps. I wouldn’t expect our approach to a SPA to be that uncommon. As a dev who lives in web-app world, I know very little about Android Studio or Xcode, and am not finding much in the replies that gives me any ideas what I can do to meet our need.