A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/cloudflare/templates below:

cloudflare/templates: Templates for Cloudflare Workers

Templates for Cloudflare Workers

Cloudflare Workers let you deploy serverless code instantly across the globe for exceptional performance, reliability, and scale. This repository contains a collection of starter templates for building full-stack applications on Workers. You are encouraged to use, modify, and extend this code!

There are two ways to start building with a template in this repository: the Cloudflare dashboard and C3 (the create-cloudflare CLI).

Starting from the Dashboard

After logging in or signing up through the Cloudflare dashboard, open the Workers templates page and select a template to get started with. From here, you can create a repository and deploy your first Worker without needing a local development environment.

To get started locally, run one of the following commands:

npm create cloudflare@latest
# or
pnpm create cloudflare@latest
# or
yarn create cloudflare@latest

For more information on getting started with our CLI, check out the getting started guide.

Questions about Workers? Join the official Cloudflare Discord or check out the Workers docs!

This repository includes a comprehensive Playwright-based E2E test suite that validates all templates to ensure they work correctly. The test system supports both local development mode (spinning up dev servers) and live mode (testing against deployed templates).

Local Development Mode (Default)

By default, tests run against locally started development servers:

# Run all E2E tests
pnpm run test:e2e

# Run tests for specific templates
pnpm run test:e2e astro-blog-starter-template.spec.ts
pnpm run test:e2e saas-admin-template.spec.ts

# Run tests with UI mode for debugging
pnpm run test:e2e --ui

In local mode:

Live Mode (Testing Deployed Templates)

To test against live deployed templates, set the PLAYWRIGHT_USE_LIVE environment variable:

# Run tests against live deployed templates
pnpm run test:e2e:live

# Run specific template tests in live mode
pnpm run test:e2e:live saas-admin-template.spec.ts

In live mode:

The test system includes:

Template tests should be named {template-name}.spec.ts and placed in the playwright-tests/ directory:

import { test, expect } from "./fixtures";

test.describe("My Template", () => {
  test("should render correctly", async ({ page, templateUrl }) => {
    await page.goto(templateUrl);
    await expect(page.getByRole("heading", { name: "Welcome" })).toBeVisible();
  });
});

The templateUrl fixture automatically provides the correct URL (local dev server or live deployment) based on the test mode.

Playwright includes a test code generation utility that records your actions in a chromium browswer. To start the codegen utility run

We welcome template contributions! If there's a Workers template you think would be valuable, please read our contributing guide and open an issue or pull request.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4