Publish React App To Cloudflare Pages.

Follow these commands to publish your React App to CloudFlare pages, its very simple. If you already installed wrangler and are logged in, you will need only 4 commands

If you haven't logged in or installed wrangler, then you will need these two commands first before the commands above:

List of Command: https://developers.cloudflare.com/workers/wrangler/commands/

After you have published your app, you will receive the url where you app is hosted. it will look something like this:

https://aw28af49.example.pages.dev/

Then publish your app using your custom domain:

  1. login to your Cloudflare account
  2. On the left menu, select "Pages"
  3. Find the app you just created and click on the title of the app
  4. Click on the Custom Domain Tab
  5. Click on Add Custom Domain button
  6. Enter the sub and domain you wish you forward your React App to: for example: sub.example.com
  7. Submit
  8. Wait a few seconds or minutes and you can how visit your new site with the new React App.
  9. Done

Thats it. now you can visit your app to the newly created sub domain: sub.example.com

Example App: /g/SCHOOL/Apps/2022/84-words-kinder

CloudFlare Pricing: https://www.cloudflare.com/plans/developer-platform/