— Deploy to Cloudflare Workers in 5 minutes or less.
Not a fan of GUIs? With the Wrangler CLI you can manage your Workers from the command line.
yarn global add @cloudflare/wranglerOnce Wrangler has installed and authenticated your account, you can now tell Wrangler to generate a new project from this template repository. my-project can be any name you want, and that will be the working directory that's created for your new project.
wrangler generate my-project https://github.com/nberlette/phlareact-
Open your favorite text editor and fill in
account_idandnameinsidewrangler.toml. I'm working on a helper script to eliminate this manual step from the process. -
The
namefield will be your desired subdomain onworkers.dev(as long asworkers_dev = true).
You can find account_id in the sidebar of your site's Cloudflare Dashboard.
cd my-project && yarn devSpool up the Wrangler Development Server and enjoy the hot reloading as you work! You can add/edit files in the pages/ folder and watch the changes take effect in real time.
Note: don't run
wrangler devor it will skip the Flareact portion of the script!
Once you're satisfied with your project's progress, and want to see how it performs in deployment, simply run the following command to publish your site:
yarn publishBased on the original Flareact Template.