Reputation: 61
I'm using axios to make network requests in the React Native app. When I build the android/ios app what would the Origin header be? In local dev, before building, it's localhost:port but how can I configure it to use my custom domain "app.mydomain.com"?
I have to set this to allow CORS in the server running at "api.mydomain.com"
Upvotes: 2
Views: 951
Reputation: 389
Thats how i am using
axios.defaults.baseURL = "https://api.domain.com/api";
axios.get("/some/endpoint").then((res) => res.data);
Upvotes: 1