Cloudflare Worker that backs the TechnoVIT gallery: lists images stored in R2 and hands back their public CDN URLs, served behind one HTTP API.
GET /gallery: lists every object under thespecial/andgeneral/prefixes in thetechno-galleryR2 bucket, and returns each as{ url, isSpecial }, whereurlpoints at the public CDN host (gallery.techno.cdn.a2ys.dev). CORS is open forGET/OPTIONSfrom any origin.- Any other path returns a plain-text
GALLERY API is running— a basic health check.
The worker itself never serves image bytes; it only lists what's in the bucket and builds the URL each image is already reachable at through the CDN.
- Cloudflare Workers (JavaScript)
- R2 for image storage
npm install
npm run dev # wrangler dev
npm run deploy # wrangler deploy
wrangler.toml binds the techno-gallery R2 bucket as GALLERY_BUCKET and routes api.techno.cdn.a2ys.dev/* (zone a2ys.dev) to this worker.
npm run dev— local dev viawrangler devnpm run deploy— deploy to Cloudflare