— Style Guide

UI Kit — Blog

Full blog composition.

dev-session May 2025 · 8 min read

Migrating the Contact Form from Netlify Functions to Cloudflare Workers

When Netlify announced their function pricing changes, I started looking for alternatives for the portfolio contact form.

When Netlify announced their function pricing changes, I started looking for alternatives for the portfolio contact form. The existing setup was a standard serverless function — short, pragmatic, and locked to a single vendor.

Goal

Move the form off Netlify Functions and onto a Cloudflare Worker, keeping the same Turnstile verification, rate-limiting, and email delivery — with zero Netlify-specific code left behind once we're done.

The migration

Cloudflare Workers give us a lot of the same affordances as Netlify Functions: a small request/response handler, a generous free tier, and first-class edge deployment. The differences are mostly in how secrets and bindings are declared in wrangler.toml, and in which runtime globals are available.

"The point isn't that Cloudflare is better than Netlify — it's that our infrastructure should survive a vendor outage, a pricing change, or a routine platform pivot without rewriting the app."

What we kept

  • Turnstile bot protection in front of every submission
  • A per-IP rate limit (10 requests / 15 minutes)
  • Postmark for transactional delivery

The working version is deployed and the old Netlify function is gone. Total round-trip time — from first commit to production — was under four hours.