title: My axios instance does not work and I do not know why
body: <p>I have created a seperate axios.js file for an axios instance to make requests to an API I have running live. When I use the axios instance in my login route I get a
  POST <a href="http://127.0.0.1:3000/login" rel="nofollow noreferrer">http://127.0.0.1:3000/login</a> 404 (Not Found) error, even though the url defined in my axios instance is not my localhost it is the url of the API. Now, when I use axios in my login route and enter the whole API url instead of using the instance, the POST request goes to the correct url and I get proper response. I do not understand this. Everything on the API is fine and has been tested many times AND I have used an axios instance like this before.</p>
  <p>here is the instance I have set up(baseUrl is correct in my code):</p>
  <pre><code>import axios from 'axios';
  
  const axiosInstance = axios.create({
    baseUrl: REMOVED,
    headers: {
      Authorization: localStorage.getItem('accessToken')
        ? 'Bearer ' + localStorage.getItem('accessToken')
        : null,
      'Content-Type': 'application/json',
    },
  });
  
  export default axiosInstance;
  </code></pre>
  <p>here is the login function that uses my axios instance and does not work:</p>
  <pre><code>export const login = (email, password) =&gt; (dispatch) =&gt; {
    axiosInstance
      .post('/login', { email: email, password: password })
      .then((res) =&gt; {
        dispatch({
          type: LOGIN_SUCCESS,
          payload: res.data,
        });
      })
      .catch((err) =&gt; {
        console.log(err);
        dispatch({
          type: LOGIN_FAIL,
        });
      });
  };
  </code></pre>
  <p>here is the login function that works perfectly:</p>
  <pre><code>export const login = (email, password) =&gt; (dispatch) =&gt; {
    axios
      .post('fullurlnotshown/login', { email: email, password: password })
      .then((res) =&gt; {
        dispatch({
          type: LOGIN_SUCCESS,
          payload: res.data,
        });
      })
      .catch((err) =&gt; {
        console.log(err);
        dispatch({
          type: LOGIN_FAIL,
        });
      });
  };
  </code></pre>
  <p>EDIT: SOLVED THE PROBLEM... 'baseUrl:' in the instance should be 'baseURL:'</p>