This is an example worker for the R2 Uploader, you can use the code in the ./dist
folder directly, or build the code yourself.
- Node.js installed (v16 +)
-
Clone this repository
git clone https://github.com/jw-12138/r2-uploader-example-worker.git
-
Install the dependencies
npm install
-
Edit
wrangler.toml
, changer2_buckets -> bucket_name
to your own bucket name -
Deploy the code
npm run deploy
-
Push your API key
npx wrangler secret put AUTH_KEY_SECRET
This command will prompt you input the value, press
Enter
to confirm.
And that's it, your worker is now ready to be used in R2 Uploader.