title: EmberJs as a PhoneGap with external API
body: <p>please can you advise on the following:</p>
  
  <p>I have a web application written in emberjs with Rails as back-end. And now I'm going to port this application with phonegap to iOS, and the thing that I'm struggling is how to set my API endpoint that will be working in iPhone?</p>
  
  <p>As I understand EmberJs when used on the web via browser, uses your current location to issue API requests, but this approach doesn't working when using the application as iOS app.</p>
  
  <p>I'm really looking for some elegant solution to simply replace the host name or something?</p>
  
  <p>Thanks for help!</p>
  
  <p>UPDATE:</p>
  
  <p>This one works for changing the API URL</p>
  
  <pre><code>DS.RESTAdapter.reopen({
    url: 'http://somedomain.com'
  });
  </code></pre>
  
  <p>But now, there is access-controll issue:</p>
  
  <pre><code>Origin http://somedomain.com is not allowed by Access-Control-Allow-Origin. 
  </code></pre>