Here are things I learnt when building applications using serverless functions (primarily Cloudflare Workers, previously GCP Functions) and edge/distributed databases (Turso, Cloudflare D1, Neon).
6 posts tagged with "cloudflare"
View All TagsCloudflare Worker's Bindings in tRPC
When using Cloudflare Workers, the main selling point is you can integrate with a lot of other Cloudflare APIs, like D1 (database), R2 (storage) and Durable Objects (websockets), and more. However, there isn't any documentation on how to do that.
tRPC, Astro and Cloudflare Workers
I haven't seen if Astro, tRPC and Cloudflare Workers go well together. I found myself asking: must tRPC be in a separate package/deployment (e.g. packages/
in a monorepo, or separate Cloudflare Worker). I also managed to get Cloudflare bindings to work (e.g. D1, environment variables, R2). I'm pleased to say it's relatively straight forward - there are a few options.
Replacing SSH over Cloudflare with Tailscale
I wrote SSH into your private machines from anywhere, for free, using Cloudflare Tunnel in April which led to a lot of discussion on Hacker News. A lot of people started mentioning alternatives (Tailscale, ZeroTier and issues with Cloudflare).
SSH into your private machines from anywhere, for free, using Cloudflare Tunnel
Outcome
By the end of this post, you'll be able to run: ssh $machine_name
from anywhere in the internet-connected planet, using SSH keys. It is free and requires no future maintainance. This guide uses Cloudflare Tunnel, a service by Cloudflare with a free-tier. It will filter traffic to your machines through Cloudflare's network, including authenticating you. Because of this, your machines won't directly be exposed to threat actors and "1337 haxors".
This was discussed on Hacker News.
Using Cloudflare Products for 2 years
Cloudflare provides a generous free tier for many of their useful products. I list them below (and will keep them updated as I use more). Some products do have some downsides during development, even when working at small-scale. I'm happy to say I overcame them, and want you to help you do the same.
⚠️ Warning ⚠️: This page also includes random technical details to help you solve issues. ⚠️