Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

cmackenzie1/r2-public-worker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

r2-public-worker


A Cloudflare Worker to make your R2 bucket public!

Minimum Requirements

  1. Cloudflare Account
  2. wrangler >= 2.0.2

Note: Ensure you are using at the minimum specified version of wrangler.

Setup

  1. Fork this repo

  2. Install dependencies (including Wrangler 2)

npm install
  1. Create a bucket to be made public
wrangler r2 bucket create public
  1. Update the wrangler.toml to bind the R2 bucket
[[r2_buckets]]
binding = 'PUBLIC' # <~ valid JavaScript variable name
bucket_name = 'public'
  1. Deploy the worker!
wrangler publish
  1. 🎉 You've got a public bucket

Give it a try: https://r2-public-worker.cdmacken.workers.dev/duck.png

URL's even support spaces! https://r2-public-worker.cdmacken.workers.dev/space%20duck.webp

About

Cloudflare Worker to make a R2 Bucket public!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published