Cloudflare offers generous limits with their free offering. One of the products included is Cloudflare workers. You can host serverless projects without having to worry about how and where to host them.

Cloudflare has another product Cloudflare Pages which can be used for hosting static sites. It seems like active development on Pages has stopped, and Clouflare recommends using Workers instead. Docs for hosting static assets are here. But it's not immediately clear from the docs how you wouldd host a simple static website generated using 11ty.dev.

Turns out, it's quite simple:

  1. 1.

    Install Wrangler CLI - This makes it easier to interact with Cloudflare APIs.

  2. 2.

    In your static web site project - add a wrangler config wrangler.jsonc. These are the minimal required attributes:

    • name - unique cloudflare worker project name.

    • assets - a directory which contains the html, css, js files, handwritten or generated by 11ty.dev.

    • compatibility_date - set this to current date. Docs here

    • routes -

      • pattern - the url at which the static site needs to be hosted.

      • custom_domain - whether you want to let cloudflare set up DNS records and issue certs for you. Docs here

This is how this website's wrangler config looks like:

{
  "name": "til-kranti-me",
  "assets": { "directory": "public" },
  "compatibility_date":"2025-09-14",
  "routes": [
    { "pattern": "til.kranti.me", "custom_domain": true }
  ]
}
  1. 3.

    Run wrangler deploy and that's it! 🎉

All for at-cost domain I bought (rent?) from Cloudflare. Thanks Cloudflare!