Creating a Worker to use R2 Bucket Assets

I have a NextJS/Vercel project ( that Ive been setting up on Cloudflare but am struggling to access the assets in my R2 Bucket (

It seems like the best approach is to use a worker to serve up the image url like, except Im only finding examples of doing it from a code editor. I would like to do this portion from the Cloudflare UI as Im new and still getting accustomed to everything.

It also feels like this is a pretty standard need and that there should be an easy template I can use for the worker, but haven’t been able to find anything of the sort.

There is an example here:

You can put this into the dashboard Quick Edit and then in Worker settings add a bucket with a binding name of MY_BUCKET and it will work.

You can also consider the Public Buckets feature which does not require a Worker:

1 Like

Ok so I just realizing that the domain I set up is working

I had issues with my DNS recently solved so that looks like it cleared up any public access issues. Thank you, this is much easier than setting up a worker.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.