Start from existing
To deploy a pre-existing static site project, you’ll need to start with a pre-generated site. Workers Sites works well with all static site generators! For a quick-start, check out the following projects:
Once you have a site generated, follow these steps:
Run this Wrangler command in the root of your project’s directory:
$ wrangler init --site my-static-site
This command creates a few things:
Add your site’s build directory to the
[site]bucket = "./public" # <-- Add your build directory name here!entry-point = "workers-site"
The default directories for the most popular static site generators are listed below:
wrangler.toml. You can find your
account_idon the right sidebar of the Workers or Overview Dashboard. Note: You may need to scroll down! For more details on finding your
You can preview your site by running:
$ wrangler preview --watch
Then, update your
Personal Domain: Add your
zone_id = "42ef.."route = "example.com/*"
workers_devto true. This is the default.
$ wrangler publish