Letting user choose cordova endpoint/url vs spa?
-
Hi,
I have made a SPA which works fine when served as dev or production over https, without CORS and tightly secured otherwise, where the backend is a Spring boot application.
Now when building it for android, loading the app on the phone or emulator. What is the address the app is served from? Can I change it?
For example, if I make a xhr/axios get-request, where to will it go by default? To localhost?
How do I let the user, enter a url (say together on the login page) and use that for the rest of every axios or websocket connections? Save the user-entered url to LocalStorage, and load it with a boot file, just like loading the auth-keys?
Will the app need any extra settings to allow this, like cors, or does the server need to allow all origins?
-
I solved it like so, add a “url” input to login page, then set that url to axios and when making new WebSocket(url).
Then enabled CORS on the server to allow origin *