INTEGRITY Cloudflare Docs

Start from scratch

This guide shows how to quickly start a new Workers Sites project from scratch.

Getting started

  1. Ensure you have the latest version of git and Node.js installed.

  2. In your terminal, clone the worker-sites-template starter repository. The following example creates a project called my-site:

    git clone --depth=1 --branch=wrangler2 https://github.com/cloudflare/worker-sites-template my-site
  3. Run npm install to install all dependencies.

  4. You can preview your site by running the wrangler dev command:

    wrangler dev
  5. Deploy your site to Cloudflare:

    npx wrangler deploy

Project layout

The template project contains the following files and directories:

Customize the wrangler.jsonc file:

Learn more about configuring your project.