Can R2 how websites like AWS S3 or does Cloudflare pages have an API for that?

What is the name of the domain?

What is the issue you’re encountering

May I ask to describe a bit more in detail what you’re trying to accomplish with Cloudflare R2 object storage? :thinking:

Apparently I can’t edit the initial post but I’d like to create a CMS.

For each website I’d like to create static files in R2 that will act as a Website like AWS S3 feature.

If that’s not possible, I want to know if there’s an API for Cloudflare pages to create website on the fly and also update or delete files from the website.

Is it more clear?

I’d suggest using Cloudflare Pages in such case, with which you can host static generators and frameworks such as NuxtJS, connect with D1 database, Workers, create functions, etc. and connect with custom domain as website.com :thinking:

Some CMS ideas:

Otherwise, I use R2 to host and serve my static files as under “CDN” sub-domain, e.g. cdn.domain.com for my main domain.com in few cases.

I think maybe what I said was unclear or I misunderstood your answer.

My goal is to create a website builder (CMS) that creates static sites for other people.
The steps would be something like :

  • Users would register on my app (whatever stack it is made in)
  • They create a bunch of pages
  • I store the HTML/CSS/JS of those pages in a R2 folder with a kind of ID
  • They connect a domaine to the said folder (and thus cloudflare)
  • When people visit their domaine, it serves directly the folder, it doesn’t go through my app

This is what i’d like to to.

On AWS S3, this is possible by creating a bucket for each site, then connecting the user’s domain programmatically, the use would then just do a CNAME pointing on the bucket name I give them.

Anytime the user updates the site through my app, i’d update their bucket and that’s it.

I’d like to do the same on R2 or through Pages, is that possible?
Does R2 API have something to connect a domain per folder or something because I didn’t see anything about that.

And for Pages, I can’t see a programmatic way of sending files to it, neighter if the CDN is active by default or not on it.

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