HostingCo Platform

A reference implementation of the Cloudflare for SaaS pattern

Hosted Customer Sites

Each customer has their own domain. All running on the same platform, all protected by Cloudflare. Click any one to see their branded site.
Portland Coffee
portland-coffee.tarheel.us
Cafe Pro Hosting Live
Stackpath Consulting
stackpath-consulting.tarheel.us
Professional Services Business Hosting Live
Riverside Fitness
riverside-fitness.tarheel.us
Fitness Starter Hosting Live
Puppy Co
puppy-co.org
Pet Retail Business Hosting Live

How It Works

This is the Cloudflare for SaaS multi-tenant pattern. One Worker serves all customers, branding decided at the edge based on the incoming hostname.
Platform Domain
platform-demo.tarheel.us
Customer Domains
4 active
SSL Certs
Auto-issued by Cloudflare
WAF
Same ruleset for all
Origin
One Worker, all tenants
Routing Logic
Host header lookup

The Pattern in Code

The entire multi-tenant routing logic is about 5 lines. Cloudflare's edge handles the rest.
// One Worker, many tenants.
const host = request.headers.get('host');
const customer = CUSTOMERS[host];
if (!customer) return new Response('404', { status: 404 });
return renderCustomerSite(host, customer);