title: Vue. js CORS issues, backend data blocked by CORS policy
body: <p>I am using Vuejs with CLI 3.6.3 and i am facing CORS issue so i can not get the backend api data.</p>
  
  <p>The error message is :</p>
  
  <pre><code>Access to XMLHttpRequest at 'http://...' 
  from origin 'http://localhost:8080' 
  has been blocked by CORS policy: 
  No 'Access-Control-Allow-Origin' header is present on the requested resource.
  </code></pre>
  
  <p>I do create a vue.config.js file :</p>
  
  <pre><code>module.exports = {
      devServer: {
        proxy: 'https://my/site/myapi/myindex.php',
    }
  }
  </code></pre>
  
  <p>import axios and declare crossDomain equals true:</p>
  
  <pre><code>import axios from "axios";
  axios.defaults.crossDomain = true;
  </code></pre>
  
  <p>And at the backend i do declare: </p>
  
  <pre><code>header('Access-Control-Allow-Origin: *');
  header('Access-Control-Allow-Headers: X-Requested-With');
  </code></pre>
  
  <p>How can i access the backend api data without facing CORS issues ?</p>