title: Cannot fetch data from Rails at ReactJS
body: <p>I am using front-end source is ReactJS at port 5555, and my back-end is Rails at port 8888. I was trying to fetch data from Rails at React by using:</p>
  
  <pre><code>const url = 'http://localhost:8888/problems';
  fetch(url)
    .then(res =&gt; {
      res.json();
    })
    .then(response =&gt; {
      console.log(response);
    })
    .catch(error =&gt; {
      console.log(error);
    });
  </code></pre>
  
  <p>but I was received the message:</p>
  
  <pre><code>Access to fetch at 'http://localhost:8888/problems' from origin 'http://localhost:5555' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
  </code></pre>
  
  <p>I have no idea about that error. Please help me to fix it</p>