A cloudflare worker based REST API for your R2 bucket.
Usage:
- Change the
bucket_nameandpreview_bucket_nameinwrangler.tomlif you want. - Set
API_TOKENin the worker secrets using Wrangler CLI.
Endpoints:
- GET
/:key: Public access - POST
/: Requireauthorization: Bearer TOKENheader, whereTOKENshould matchAPI_TOKENfrom your worker secrets. The request content type should bemultipart/form-datawith following fields:prefix: optional prefix for the key, see blowfile:Filefile to upload
The object key is generated from prefix + uuid() + file.extension