How to properly change default hostname "https://localhost" for production? Should I change it? (api requests/CORS problems) #17766
Unanswered
Angel009
asked this question in
CLI - Capacitor / Cordova modes
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone!
I was testing my app and discovered that my server (django) doesn't get any API calls made from the app If I change the default origin(https://localhost). I checked my CORS configuration and works fine from any browser and android device (I'm not allowing all origins). However, the origin of the request comes as "https://localhost" from the mobile version.
I added this to capacitor.config.json based on the capacitor docs (the hostname is the same as the web domain):
"server": { "hostname": "production.hostname.app", "androidScheme": "https" }
If I do that, the server wont even get any API request from the mobile version.
Should I change the default https://localhost ? If so, How?
I'm on a pre-prod environment(real servers, real domains, ssl certificates, etc)
Beta Was this translation helpful? Give feedback.
All reactions