title: enabling cors in codeigniter ( restserver by @chriskacerguis )
body: <p>http.get request in agularJs controller works fine when my client app and api are in localhost.
  when api is moved to server., issue arised.</p>
  <p>client side using angularJs</p>
  <pre><code>$http.get('http://example.com/api/spots/2/0').success(function(data){
  console.log(data);
  });
  </code></pre>
  <p>log gives:
  Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="http://example.com/api/spots/2/0" rel="nofollow noreferrer">http://example.com/api/spots/2/0</a>. This can be fixed by moving the resource to the same domain or enabling CORS.</p>
  <p>i have added these two lines to my controller construct</p>
  <pre><code>header(&quot;Access-Control-Allow-Origin: *&quot;);
  
  header(&quot;Access-Control-Allow-Methods: GET&quot;);
  </code></pre>
  <p>still same error.</p>