title: What's the best way to store URLs, or URL domains, in AngularJS app?
body: <p>My AngularJS app makes calls to an API which is currently hosted at one service, but was previously hosted at a different one, and in the near future is likely to be hosted yet somewhere else.</p>
  
  <p>The URL is regularly changing. For example from</p>
  
  <pre><code>myfirst.heroku.com/app/user/mike/profile
  </code></pre>
  
  <p>to </p>
  
  <pre><code>mysecond.bluemix.com/app/user/mike/profile
  </code></pre>
  
  <p>etc.</p>
  
  <p>Instead of changing the URL in every location everytime, I want to just have to change the part before the <code>/app...</code>. </p>
  
  <p>In an Angular App what is the best way to do this?</p>
  
  <p><strong>NOTE:</strong> Many of the URLs I use throughout the app, are in modules that are added as dependencies to my main app. So <code>Module1</code> and <code>Module2</code> both use the URL in their controllers and resources and are then included in <code>MainApp</code>. So a good solution for me needs to be accessible to all dependee apps. Is that possible.</p>