What even is this?
Hey, welcome to the first post of my blog! This is truly a self documenting experience, where I aim to document my learnings of Cloudflare workers to the world.
So let’s get started. How do we even start to create a blog? I’m a backend dev myself with minimal frontend experience, but in total, this setup took me about 30 minutes from start to finish. That includes the creation of the repository down to the publishing of the site to Cloudflare Workers. In fact, the content took longer than the actual creation! I am to document that here for you, in this blog post.
Figuring out a framework
First, you’ll need to settle on a framework. Workers supports many different frameworks for static sites (which just released last week!).
When it comes to building a new blog, selecting the right framework can significantly impact your development experience and the final product. After exploring various options, I decided to go with Astro, and here’s why.
Astro stands out for its ability to create fast, optimized static sites with minimal hassle. One of the biggest benefits is its support for multiple front-end frameworks. Whether you prefer React, Vue, or Svelte, Astro allows you to use them side by side, giving you the flexibility to choose the best tool for each task. This means you can harness the power of components while keeping your project lightweight.
Astro’s friendly and intuitive documentation made it easy for me to get started, even with limited frontend experience. The vibrant community around Astro also provides plenty of resources and support, ensuring I have help when needed. Plus, my co-workers use Astro in their personal projects, so it’s easier to bug them for support :)
Using a template
Once you’ve figured out a framework, if you’re anything like me, you’ll likely want to use a template. There’s no point in re-inventing the wheel for a simple blog post like this!
Simply run npm create astro@latest blog in your terminal, and you’ll be prompted to set up a new project: 
Choose “Use blog template”. Next, run npm run build, which will generate your optimized build outputs into the dist directory.
Uploading to Cloudflare
This is where things get fun. You can easily upload a new website to Cloudflare using Workers with static assets (as previously mentioned just released!).
First we’ll need a wrangler.toml. Let’s create a new file in the root of our directory with the following contents:
#:schema node_modules/wrangler/config-schema.json
name = "my-new-blog"
compatibility_date = "2024-10-04"
compatibility_flags = ["nodejs_compat"]
[assets]
directory="dist"
Then, we’ll run npx wrangler deploy, which will handle the creation of our project. Wrangler will upload our dist directory to Cloudflare and create a new project on our behalf. A new workers.dev zone will be created for you. And did I mention the best part? It’s all free!
And there you have it!
In this post you’ve got a super simple path to follow for setting up your own blog post! We’ve identified some helpful wrangler commands you can use, and
