title: $http.get requests with localhost address when deploying on cloud server
body: <p>I have an AngularJS factory function like:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>service.getUserRates = function() {
    return $http.get('https://localhost:8443/portfolio/get-user-rates');
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>This works fine on localhost, but before deploying on digital ocean servers I have to update the URL to include the IP address of the server -  <code>$http.get('http://67.205.xx.xxx:8443</code>, instead of <code>localhost</code> or I get an <code>ERR_CONNECTION_REFUSED</code> error.</p>
  
  <p>This is hard to manage since I am developing on local machine and pulling changes into cloud server, I have to keep changing the URL every time I do a new git push / pull.</p>
  
  <p>What is the easiest / best way to manage this so I don't have to manually change the URLs repeatedly?</p>