title: Setting baseURL for axios for use with Stripe / React
body: <p>Im currently trying to proccess payments using Stripe with react. However following the tutorial, i get an error 404 that my api/payment_intents is not found.</p>
  <pre><code>
  const stripe = new Stripe('here is my key');
  
  export default async (req, res) =&gt; {
    if (req.method === &quot;POST&quot;) {
      try {
        const { amount } = req.body;
        // Psst. For production-ready applications we recommend not using the
        // amount directly from the client without verifying it first. This is to
        // prevent bad actors from changing the total amount on the client before
        // it gets sent to the server. A good approach is to send the quantity of
        // a uniquely identifiable product and calculate the total price server-side.
        // Then, you would only fulfill orders using the quantity you charged for.
  
        const paymentIntent = await stripe.paymentIntents.create({
          amount,
          currency: &quot;usd&quot;
        });
  
        res.status(200).send(paymentIntent.client_secret);
      } catch (err) {
        res.status(500).json({ statusCode: 500, message: err.message });
      }
    } else {
      res.setHeader(&quot;Allow&quot;, &quot;POST&quot;);
      res.status(405).end(&quot;Method Not Allowed&quot;);
    }
  };
  
  </code></pre>
  <p>Here is the axios post</p>
  <pre><code>const { data: clientSecret } = await axios.post(&quot;../api/payment_intents&quot;, {
              amount: this.state.amount * 100
            });
  </code></pre>
  <p>I read in another post i need to set a baseURL but im unsure how to/what that even means. Any help would be greatly appreciated</p>
  <p>UPDATE: using &quot;localhost:3000/api/payment_intents&quot; i was able to get a different error message about CORS policy</p>
  <p>Access to XMLHttpRequest at 'localhost:3000/api/payment_intents' from origin 'http://localhost:3000' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.</p>