title: Issues connecting to my Node.js and MongoDB backend using a React and axios front end
body: <p>I am struggling currently when making a call using Axios to my backend, I currently have a user register page and I want to send the user data to the backend, everything seems to be set up correctly but I get these errors inside of my google chrome.</p>
  
  <p><a href="https://i.stack.imgur.com/zrmQk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zrmQk.png" alt="enter image description here"></a> </p>
  
  <p>Here is the code from my React Register.js that breaks my program and causes this error. </p>
  
  <pre><code>  onSubmit(e) {
      e.preventDefault();
  
      const newUser = {
        name: this.state.name,
        email: this.state.email,
        password: this.state.password,
        password2: this.state.password2
      };
  
       axios.post('api/users/register', newUser) //EDIT : Line 35, where the error is
       .then(res =&gt; console.log(res.data))
       .catch(err =&gt; console.log(err));
    }
  </code></pre>
  
  <p>The onSubmit is connected to a button at the bottom of the website and all the code there is %100 fine. One issue that might be hurting me here is that my server is on localhost5000 while my front end is running on localhost3000 on my computer. I don't know how to fix this or what to do next, I've looked everywhere and this small issue is incredibyly frustrating.</p>
  
  <p>Any help , pointers or general advice would be greatly appreciated as this seems like an extremely trivial error. Thanks in advance for any help.</p>