본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)48k · #4165

cloudflare-pages

하는 일

Cloudflare Pages는 코드로 만든 웹사이트와 애플리케이션을 인터넷에 게시하게 해 줍니다. 기술적인 부분을 모두 처리해서, 사이트가 전 세계에서 안전하고 빠르게 접근되도록 합니다.

사용하는 경우

  • ✓코드로 만든 웹사이트나 앱이 있고 이를 온라인에 올리고 싶을 때.
  • ✓전 세계 어디서나 사이트가 빠르고 안전하기를 원할 때.
  • ✓코드를 바꿀 때마다 자동으로 나타나는 테스트용 버전을 갖고 싶을 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/cloudflare-pages/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“React 사이트를 Cloudflare Pages에 올리고 싶어요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

코드(GitHub 같은 곳에 저장된)를 Cloudflare에 연결합니다. 그러면 Cloudflare가 코드를 빌드하고, 인터넷에서 접근할 수 있게 하며, 사이트 주소를 만들어 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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 });
  }

…
자주 묻는 질문

사용하려면 돈을 내야 하나요?

아니요, Cloudflare Pages에는 대부분의 개인 및 소규모 프로젝트에 충분한 무료 요금제가 있습니다.

프로그래밍 전문가여야 하나요?

웹사이트의 코드가 이미 준비되어 있어야 합니다. 이 안내는 이미 프로젝트가 있어서 게시하려는 사람을 위한 것이며, 아무 지식 없이 처음부터 만드는 사람을 위한 것은 아닙니다.

‘미리 보기 배포’란 무엇인가요?

코드의 초안을 올릴 때마다 자동으로 만들어지는 사이트의 임시 버전입니다. 정식으로 공개하기 전에 테스트하는 데 좋습니다.

상세 정보

작성자의 원본 설명

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

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4165
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬