title: How to fixed 429 (Too Many Requests)?
body: <p>I am creating a custom hook in React for fetching jobs from GitHub jobs API. But CORS creating problems.So I also use <code>const BASE_URL = 'https://cors-anywhere.herokuapp.com/https://jobs.github.com/positions.json';</code>
  This throwing error 429 (Too Many Requests). I do not use any backend.
  This hook will be called once from app.js while loading application.</p>
  <h2>useFetchJobs.js</h2>
  <pre class="lang-js prettyprint-override"><code>import { useReducer, useEffect } from 'react';
  import axios from 'axios';
  
  const ACTIONS = {
      MAKE_REQUEST: 'make-request',
      GET_DATA: 'get-data',
      ERROR: 'error'
  }
  
  const BASE_URL = 'https://jobs.github.com/positions.json';
  
  function reducer(state, action) {
      switch (action.type) {
          case ACTIONS.MAKE_REQUEST:
              return { jobs: [], loading: true }
          case ACTIONS.GET_DATA:
              return { ...state, jobs: action.payload.jobs, loading: false }
          case ACTIONS.ERROR:
              return { ...state, jobs: [], loading: false , error: action.payload.error }
          default:
              return state;
      }
  }
  
  export default function useFetchJobs(params, page) {
      const [state, dispatch] = useReducer(reducer, { jobs: [], loading: true });
  
      useEffect(() =&gt; {
          dispatch({ type: ACTIONS.MAKE_REQUEST });
          axios.get(BASE_URL, {
              params: { markdown: true, page: page, ...params }
          }).then(res =&gt; {
              dispatch({ type: ACTIONS.GET_DATA, payload: { jobs: res.data }});
          }).catch(e =&gt; {
              dispatch({ type: ACTIONS.ERROR, payload: { error: e }});
          })
      }, [params, page]);
  
      return state;
  };
  
  </code></pre>
  <h2>App.js</h2>
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  
  import useFetchJobs from &quot;./useFetchJobs&quot;;
  
  import Container from &quot;react-bootstrap/Container&quot;;
  
  const App = () =&gt; {
    const { jobs, loading, error } = useFetchJobs();
    return (
      &lt;Container&gt;
        {loading &amp;&amp; &lt;h1&gt;Loading...&lt;/h1&gt;}
        {error &amp;&amp; &lt;h1&gt;Error. Please try again...&lt;/h1&gt;}
        &lt;h1&gt;{jobs.length}&lt;/h1&gt;
      &lt;/Container&gt;
    );
  }
  
  export default App;
  </code></pre>