/functions/CLAUDE.md
CLAUDE.md at /functions/CLAUDE.md
Path: functions/CLAUDE.md
Functions CLAUDE.md
Structure
pj/zpaper/api/- Cloudflare Pages Functions (serverless API endpoints)search.ts- Full-text search using MiniSearchkeyword-logs.ts- Keyword analytics API (reads from Cloudflare KV)search-data.json- Build-time generated search index (do not edit manually)
Conventions
- Functions are TypeScript, using Cloudflare Pages Functions format
search-data.jsonis generated byblog/scripts/generate-search-index.mjs- Data storage uses Cloudflare KV (
KEYWORD_LOGSbinding) - Functions are deployed via
wrangler pages deployin CI (see.github/workflows/)
Routing
Cloudflare Pages Functions use file-based routing:
/pj/zpaper/api/search→functions/pj/zpaper/api/search.ts/pj/zpaper/api/keyword-logs→functions/pj/zpaper/api/keyword-logs.ts