jonben
CDCloudflare Developers
•Created by jonben on 10/20/2023 in #pages-help
Setting up a static website generator with Cloudflare Pages
Hi,
We are dev team working on a new feature on top of our platform for restaurant reservations management.
We would like to start offering to our clients simple websites, which we would generate with a "restaurant website generator".
From our Admin Panel, ou team would setup a restaurant website from the restaurant profile, parameter it with domain name, set texts, upload logo and photos and "launch" it.
We already have 3 custom restaurant website templates in HTML (only a few pages, index.html, contact.html, menu.html, privacy-policy.html), all data needed can already be created in our backend and is accessible through our API.
We're looking into the best technical solution to achieve this and to host the websites as static websites for the best SEO, likely on Cloudflare Pages.
Whatever the solution chosen we will likely have to setup on the server/infrastructure each new domain and have a SSL certificate generated.
We are thinking about generating static websites : we generate the websites' HTML on demand from our backend app and send them to the infrastructure through an API.
Is Cloudflare Pages the right way for that?
We would not have a repository for each website, just static HTML files. Can we create new websites, setup domain name, upload HTML files via the Cloudflare API?
An alternative would be a Dynamic Website Generator : the website is generated by the frontend depending on the domain name requested, with data fetched from our API. We initially thought we would use Astro (JS framework) for this, we built websites this way before, but we can't manage to retrieve the domain name and send it to the API. We are looking to use Nuxt or Next instead.
14 replies