595 B
595 B
A cloudflare worker based REST API for your R2 bucket.
Usage:
- Change the
bucket_nameandpreview_bucket_nameinwrangler.tomlif you want. - Set
ENCRYPT_SECRET(>= 32 chars) in the worker secrets using Wrangler CLI.
Endpoints:
- GET
/:key: Public access - POST
/: Requireauthorization: Bearer TOKENheader, whereTOKENis an encrypted JWT using@proselog/jwtandENCRYPT_SECRET. The request content type should bemultipart/form-datawith following fields:file:Filefile to upload
The object key is generated from $userId/ + uuid() + file.extension