cf-edge-api

Automate Cloudflare Pages Functions edge API endpoints with middleware and Prisma.

Updated Nov 16, 2025
One-click install
npx skills add https://github.com/aaronjullger-lgtm/PANaCEa --skill cf-edge-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cf-edge-api
Source: https://github.com/aaronjullger-lgtm/PANaCEa/tree/main/.claude/skills/cf-edge-api
Command: npx skills add https://github.com/aaronjullger-lgtm/PANaCEa --skill cf-edge-api

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Cloudflare Pages Functions (edge) API development patterns solve the challenges of building scalable, production-ready endpoints at the edge. This skill provides templates, middleware patterns, and deployment guidance tailored for PANaCEa's edge runtime.

Core Features & Use Cases

  • File-based routing guidance for Cloudflare Pages Functions under functions/api and local development routes.
  • Middleware patterns for authentication, CORS, and rate limiting to secure edge endpoints.
  • Prisma edge client usage and edge-runtime considerations, including proper disconnection and no lib imports.
  • Deployment, debugging, and maintenance guidance for edge APIs in a two-backend setup (functions/api vs routes).

Quick Start

Create a new edge API endpoint in functions/api/ following file-based routing, with proper CORS, authentication, and Prisma edge usage.

Frequently Asked Questions about cf-edge-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create Cloudflare Pages Functions with authentication and CORS middleware?

To create Cloudflare Pages Functions with authentication and CORS middleware, use pattern-driven templates that apply file-based routing under functions/api, standardizing endpoint security and request handling at the edge.

Does Prisma edge client work with Cloudflare Pages Functions?

Yes, the Prisma edge client works with Cloudflare Pages Functions by applying specific edge-runtime constraints, requiring proper disconnection after queries and avoiding standard lib imports.

What are the edge runtime constraints for Cloudflare Pages APIs?

Edge runtime constraints for Cloudflare Pages APIs prohibit using process.env and lib imports, requiring standardized onRequestGet/Post templates with proper error handling to ensure execution within edge limitations.

How do I set up file-based routing for a Cloudflare edge API?

Set up file-based routing for a Cloudflare edge API by structuring endpoints under functions/api and local development routes, enabling automated creation and maintenance of scalable edge API paths.

Can I use rate limiting in a Cloudflare edge API?

Yes, you can implement rate limiting in a Cloudflare edge API by applying middleware patterns designed for edge endpoints, securing production-grade APIs against excessive traffic requests.

Why does my edge API fail when importing from a local lib directory?

Your edge API fails when importing from a local lib directory because edge runtime constraints prohibit lib imports, requiring you to adapt endpoint templates to avoid restricted dependencies.