title: No 'Access-Control-Allow-Origin' header is present when using Angular
body: <p>I am trying to oauth to twitter using <strong><em>angular</em></strong> -> <strong><em>node</em></strong> -> <strong><em>twitter</em></strong> but i keep getting the error <code>No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access</code> when adding angular to the mix. My app configuration..</p>
  
  <ul>
  <li>Angular UI running on port 4200</li>
  <li>Express Node Server running on port 3000</li>
  <li>CORS on server is set to Allow-Access-Origin localhost:4200 for Angular to Node
  api calls.</li>
  </ul>
  
  <p>Using express templates that call call express routes works fine as shown below</p>
  
  <p><strong>template  -> localhost:3000/auth/twitter</strong></p>
  
  <pre><code>Response Headers
      Access-Control-Allow-Credentials:true
      Access-Control-Allow-Origin:http://localhost:4200
      Location:https://api.twitter.com/oauth/authenticate?oauth_token=placeholdertokenstackoverflow
      Vary:Origin
  
  Request Headers
      Host:localhost:3000
      Referer:http://localhost:3000/
  </code></pre>
  
  <p><strong>localhost:3000/auth/twitter -> //api.twitter.com/oauth/...</strong></p>
  
  <pre><code>GENERAL
      Request URL:https://api.twitter.com/oauth/authenticate?oauth_token=placeholdertokenstackoverflow
      Request Method:GET
      Status Code:200 
  
  Request Headers
      :authority:api.twitter.com
      :method:GET
      :scheme:https
      referer:http://localhost:3000/
  </code></pre>
  
  <p>When using angular to call express routes instead of templates, causes what i assume is a CORS error as shown below</p>
  
  <p><strong>angular.http.get -> localhost:3000/auth/twitter</strong></p>
  
  <pre><code>RESPONSE HEADERS
      Access-Control-Allow-Credentials:true
      Access-Control-Allow-Origin:http://localhost:4200
      Location:https://api.twitter.com/oauth/authenticate?oauth_token=placeholdertokenstackoverflow
      Vary:Origin
  
  REQUEST HEADERS
      Host:localhost:3000
      Origin:http://localhost:4200
      Referer:http://localhost:4200/
  </code></pre>
  
  <p><strong>localhost:3000/auth/twitter -> //api.twitter.com/oauth/...</strong></p>
  
  <pre><code>GENERAL
      Request URL:https://api.twitter.com/oauth/authenticate?oauth_token=placeholdertokenstackoverflow
      Request Method:GET
      Status Code:200 
  
  REQUEST HEADERS
      :authority:api.twitter.com
      :method:GET
      :scheme:https
      ***origin:null
      referer:http://localhost:4200/***
  </code></pre>
  
  <p>Looking above <code>origin:null</code> appears when angular calls the express route. Even though express server is set up the same in both instances and makes the call to twitter, the headers are different which i dont understand. Does angular setting the view instead of express make the browser confused on the origin of the request?</p>