Wrangler app that generates a log upon uploading a file to an R2 bucket.
- Cloudflare:
- Must have set the
CLOUDFLARE_API_TOKEN
variable in your local environment.
- Must have set the
- pnpm:
- Must be installed in your system.
- Wrangler:
- Must be installed in your system.
Create R2 buckets:
npx wrangler r2 bucket create upload-bucket
npx wrangler r2 bucket create log-bucket
Create queue:
npx wrangler queues create event-notification-queue
Create worker:
npx wrangler deploy
Enable R2 event notifications:
npx wrangler r2 bucket notification create upload-bucket --event-type object-create --queue event-notification-queue
-
Upload a file to
upload-bucket
from the Cloudflare dashboard. -
After the upload is complete, logs will appear in
log-bucket
.
npx wrangler delete