Zum Inhalt springen
Skillpedia
Deployment & Cloud (DevOps)48k · #4165

cloudflare-pages

Was er macht

Mit Cloudflare Pages kannst du Websites und Anwendungen, die mit Code gebaut wurden, im Internet veröffentlichen. Cloudflare übernimmt alle technischen Aspekte, damit deine Seite weltweit, sicher und schnell erreichbar ist.

Wann du ihn nutzt

  • ✓Wenn du eine Website oder App mit Code gebaut hast und sie online stellen möchtest.
  • ✓Wenn deine Seite für Menschen überall auf der Welt schnell und sicher sein soll.
  • ✓Wenn du Testversionen deiner Seite haben möchtest, die automatisch erscheinen, sobald du Code-Änderungen vornimmst.

Link zum Skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-pages/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-pages/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Ich möchte meine React-Seite mit Cloudflare Pages online stellen.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Du verbindest deinen Code (gespeichert z. B. bei GitHub) mit Cloudflare. Cloudflare baut danach deinen Code und macht ihn im Internet verfügbar. Dabei wird eine Adresse für deine Seite erstellt.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Cloudflare Pages

Deploy frontend projects with preview builds, edge functions, and global CDN delivery on Cloudflare's network.

When to Use

  • Deploying static sites (React, Vue, Astro, Hugo, Next.js static export).
  • Full-stack applications using Pages Functions for server-side logic.
  • Projects that need automatic preview deployments per pull request.
  • Teams that want zero-config CDN with custom domain and TLS.
  • Migrating from Vercel, Netlify, or GitHub Pages to Cloudflare's ecosystem.

Prerequisites

  • Node.js 18+ and npm installed locally.
  • A Cloudflare account (free tier works for most projects).
  • Wrangler CLI installed: npm install -g wrangler.
  • Authenticated via wrangler login or CLOUDFLARE_API_TOKEN environment variable.
  • Source code in a Git repository (GitHub or GitLab for dashboard integration).

Project Setup via Wrangler

Create a New Project

# Create a new Pages project
npx wrangler pages project create my-site

# List existing projects
npx wrangler pages project list

# Delete a project (removes all deployments)
npx wrangler pages project delete my-site

Deploy from Local Build Output

# Build your framework first
npm run build

# Deploy the output directory
npx wrangler pages deploy dist --project-name=my-site

# Deploy with a custom branch name (triggers preview URL)
npx wrangler pages deploy dist --project-name=my-site --branch=feature-auth

# Deploy and get the deployment URL in JSON
npx wrangler pages deploy dist --project-name=my-site --branch=main 2>&1 | tail -1

List and Manage Deployments

# List recent deployments
npx wrangler pages deployment list --project-name=my-site

# Tail live logs from a deployment
npx wrangler pages deployment tail --project-name=my-site --environment=production

Dashboard Git Integration

  1. Navigate to Workers & Pages > Create application > Pages.
  2. Connect your GitHub or GitLab account.
  3. Select the repository and configure:
    • Production branch: main
    • Build command: npm run build
    • Build output directory: dist (or build, .next, public depending on framework)
  4. Set environment variables per environment (Production vs Preview).

Framework Presets

Cloudflare auto-detects frameworks. Override if needed:

Framework Build Command Output Directory
React CRA npm run build build
Vite npm run build dist
Next.js npx @cloudflare/next-on-pages .vercel/output/static
Astro npm run build dist
Hugo hugo public
SvelteKit npm run build .svelte-kit/cloudflare

Preview Deployments

Every non-production branch gets a unique preview URL automatically.

# URL format for preview deployments
https://<commit-hash>.<project-name>.pages.dev
https://<branch-name>.<project-name>.pages.dev

Branch-Based Access Control

# Set preview branch patterns in wrangler.toml (Pages-specific)
# Or configure via dashboard: Settings > Builds & deployments
# Include branches: feature/*, staging
# Exclude branches: dependabot/*

Preview Comment on Pull Requests

Enable the Cloudflare Pages GitHub App to post deployment URLs as PR comments. Configure under Settings > Builds & deployments > Preview comment.

Pages Functions

Pages Functions provide server-side logic deployed alongside your static site. Place files in a functions/ directory at the project root.

Basic API Route

// functions/api/hello.ts
export const onRequestGet: PagesFunction = async (context) => {
  return new Response(JSON.stringify({ message: "Hello from the edge" }), {
    headers: { "Content-Type": "application/json" },
  });
};

// functions/api/users/[id].ts — dynamic route parameter
export const onRequestGet: PagesFunction = async (context) => {
  const userId = context.params.id;
  return new Response(JSON.stringify({ userId }), {
    headers: { "Content-Type": "application/json" },
  });
};

Middleware

// functions/_middleware.ts — runs before all routes
export const onRequest: PagesFunction = async (context) => {
  const authHeader = context.request.headers.get("Authorization");
  if (!authHeader || !authHeader.startsWith("Bearer ")) {
    return new Response("Unauthorized", { status: 401 });
  }

…
Häufige Fragen

Muss ich dafür bezahlen?

Nein, Cloudflare Pages hat einen kostenlosen Tarif, der für die meisten persönlichen und kleinen Projekte ausreicht.

Muss ich ein erfahrener Programmierer sein?

Du brauchst deinen Website-Code bereits fertig. Die Anleitung richtet sich an alle, die schon ein Projekt haben und es veröffentlichen möchten, nicht an Leute, die ohne jegliche Vorkenntnisse erst ein Projekt erstellen wollen.

Was sind 'Preview Deployments'?

Das sind temporäre Versionen deiner Seite, die jedes Mal automatisch erstellt werden, wenn du eine Vorabversion deines Codes hochlädst. Ideal zum Testen, bevor du offiziell live gehst.

Details

Originalbeschreibung des Autors

Deploy static sites and full-stack apps on Cloudflare Pages with previews, functions, and custom domains.

repo: sickn33/agentic-awesome-skills

Beliebtheit

GitHub-Sterne
48k
Platz im Ranking
#4165
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills