title: Access to fetch at from origin 'http://localhost:3000' has been blocked by CORS policy
body: <p>Adding to the database shows the error. what should I do?</p>
  <blockquote>
  <p>Access to fetch at 'http:xxx' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: 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.</p>
  </blockquote>
  <p>my function:</p>
  <pre><code>addItem = (e) =&gt; {
      e.preventDefault();
      const ob = {
          X: 53.0331258,
          Y: 18.7155611,
      }
      fetch(&quot;http://xxx&quot;, {
              method: &quot;post&quot;,
              headers: {
                  &quot;Content-Type&quot;: &quot;application/json&quot;
              },
              body: JSON.stringify(ob)
          })
          .then(res =&gt; res.json())
          .then(res =&gt; {
              console.log(res);
          })
  }
  </code></pre>