INTEGRITY Cloudflare Docs

Get Started

For most front-end applications, you'll want to use a framework. Workers supports number of popular frameworks that come with ready-to-use components, a pre-defined and structured architecture, and community support. View framework specific guides to get started using a framework.

Alternatively, you may prefer to build your website from scratch if:

This guide will instruct you through setting up and deploying a static site or a full-stack application without a framework on Workers.

Deploy a static site

This guide will instruct you through setting up and deploying a static site on Workers.

1. Create a new Worker project using the CLI

C3 (create-cloudflare-cli) is a command-line tool designed to help you set up and deploy new applications to Cloudflare. Open a terminal window and run C3 to create your Worker project:

npm create cloudflare@latest -- my-static-site

For setup, select the following options:

After setting up your project, change your directory by running the following command:

cd my-static-site

2. Develop locally

After you have created your Worker, run the wrangler dev in the project directory to start a local server. This will allow you to preview your project locally during development.

npx wrangler dev

3. Deploy your project

Your project can be deployed to a *.workers.dev subdomain or a Custom Domain, from your own machine or from any CI/CD system, including Cloudflare's own.

The wrangler deploy will build and deploy your project. If you're using CI, ensure you update your "deploy command" configuration appropriately.

npx wrangler deploy

Deploy a full-stack application

This guide will instruct you through setting up and deploying dynamic and interactive server-side rendered (SSR) applications on Cloudflare Workers.

When building a full-stack application, you can use any Workers bindings, including assets' own, to interact with resources on the Cloudflare Developer Platform.

1. Create a new Worker project

C3 (create-cloudflare-cli) is a command-line tool designed to help you set up and deploy new applications to Cloudflare.

Open a terminal window and run C3 to create your Worker project:

npm create cloudflare@latest -- my-dynamic-site

For setup, select the following options:

After setting up your project, change your directory by running the following command:

cd my-dynamic-site

2. Develop locally

After you have created your Worker, run the wrangler dev in the project directory to start a local server. This will allow you to preview your project locally during development.

npx wrangler dev

3. Modify your Project

With your new project generated and running, you can begin to write and edit your project:

Then, save the files and reload the page. Your project's output will have changed based on your modifications.

4. Deploy your Project

Your project can be deployed to a *.workers.dev subdomain or a Custom Domain, from your own machine or from any CI/CD system, including Cloudflare's own.

The wrangler deploy will build and deploy your project. If you're using CI, ensure you update your "deploy command" configuration appropriately.

npx wrangler deploy