Deploy Static HTML Using Cloudflare

Deploy Static HTML Using Cloudflare

You might be want to show your portfolio in order to reach wider audience. One in a million way is using web based. However in the beginning you will struggle with find a hosting, domain and technical stuff to launch website. And it can be overwhelmed to know everything to make site live.

There is another solutions that can make your life more easier from Cloudflare. It's known as Cloudflare Workers. It will give us faster performance using cutting edge for content delivery network.

In order to initiate set up we need to install:

  1. Node JS
  2. NPM

After we install it make sure you have site that we want to upload. Then you can use this command from terminal/shell

wrangler generate my-app https://github.com/cloudflare/worker-sites-template

It will ask to login using our Cloudflare account and authenticate it. You can rename my-app to anything you want. It will create folder public, in this folder put all of your file and assets i.e. index.html, css, js and etc.

Change API under toml file. Then use command wrangler publish to push all of assets file. It will create workers.dev domain with project title. Finally your web has been deployed. wa

Issue: If you are using windows and run script through PowerShell, you need to aligned execution policy. Detail can be found here.