title: CORS Error when requesting route in cypress test
body: <p>I would like to mock some of the API calls done by my SPA. Therefor I am using cypress.JS and checked how to do this by using following test.</p>
  <pre class="lang-js prettyprint-override"><code>it(&quot;Then it works&quot;, () =&gt; {
      axios.defaults.baseURL = 'http://localhost';
      
      cy.server()
      cy.route(&quot;GET&quot;, &quot;http://localhost/users/&quot;, true)
      
      axios.get(&quot;/users/&quot;).then(response =&gt; {
          console.log(&quot;received response: &quot; + response)
          expect(response.body).to.equal(true)
      }).catch(error =&gt; console.log(error))
  })
  </code></pre>
  <p>It does not work I get the error &quot;Access to XMLHttpRequest at 'http://localhost/users/' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.&quot;</p>
  <p>Is there any way to prevent this error during tests? I don’t understand why Cypress is handling this simple test in a way that this error can occure.</p>