How I made free static hosting for developers
Introduction
Hello everyone! This is how I made boop.cat, the backend, the global CDN, and everything you need to know!
How do deployments work?
First, the Git repository gets cloned in the build server, then the server runs npm/yarn/pnpm/bun build or the user's specified command (using our detection) and then we ensure static output, then the static assets get uploaded to our Backblaze B2 Bucket and Cloudflare KV routes traffic and does the Global CDN.
How does the Global CDN work?
After the static assets are built, we upload it to B2 and Cloudflare KV routes traffic for the subdomain .scan.blue the user picked and that uses Cloudflare's CDN
How did you make custom domains work with the Global CDN?
Cloudflare has a tool called Cloudflare for SaaS which lets hosts of platforms let users bring their own hostnames and handles SSL for them, that's why when you set-up a custom domain in boop.cat it asks you to create a TXT to get Cloudflare to issue the SSL certificate and then the CNAME record pointing to sites.scan.blue which is the Worker that routes traffic
Conclusion
That's how I made free static hosting for developers, you can sign up today at https://boop.cat
Enjoy!