Back to blog
•
4 min read
Moving my side projects from Railway to Cloudflare

This weekend I moved three projects off Railway and onto Cloudflare Workers:

  • SlimeSheets, which syncs Google Sheets to a data warehouse and adds semantic search
  • sss4u, an AI image stylizer
  • this site

Railway was not the problem. It’s a great product, and I’d still reach for it first for anything that needs a long-running server, a database, or a container. The reason for the move is simpler: I wanted fewer moving parts.

Why: a simpler stack for building with AI

Most of my side-project code now gets written with an AI coding agent next to me. The more of the system lives in the repo as plain config, the better that works. The agent can read it, change it, and deploy it the same way every time.

None of these three apps actually needed a server:

  • SlimeSheets and sss4u are Vite + React frontends. Their backends are on Convex, with Clerk for auth.
  • This site is Astro, and every page was already pre-rendered.

Yet each one was running as a container. That meant a Railway service per app, a start command, a serve dependency or a Node adapter, and, in two cases, a Convex cron job pinging the site every five minutes so it wouldn’t cold-start.

Now each frontend is a folder of static files and one config file:

// wrangler.jsonc
{
  "name": "slimesheets",
  "compatibility_date": "2026-11-01",
  "workers_dev": false,
  "preview_urls": false,
  "assets": {
    "directory": "./dist",
    "not_found_handling": "single-page-application"
  }
}

All three repos share the same pattern: push to main, GitHub Actions runs npm run build && wrangler deploy, done. There are no containers to keep warm, so the keep-alive crons are gone too. Every project looks the same, and that makes it easy for me, or an agent, to work on any of them.

What the migration actually involved

Static apps (SlimeSheets, sss4u). I added wrangler.jsonc, a deploy script, and a deploy-frontend job that runs after the Convex deploy, so backend and frontend ship together. I deleted railway.json, serve, and the warm-up cron. not_found_handling: "single-page-application" makes deep links like /dashboard and /sso-callback load the app instead of returning a 404.

This site. Astro was set to hybrid output with the Node adapter, but nothing was rendered on the server. Switching to plain static output and dropping @astrojs/node was the whole change.

Things that bit me

  • Node version. Wrangler 4 requires Node 22. My CI was pinned to Node 20, so the first deploy would have failed. I caught it before merging.
  • Least-privilege tokens. The “Edit Cloudflare Workers” token template grants far more than a static deploy needs. Each repo gets its own token with only Account → Workers Scripts: Edit. I mint them from the terminal with a short-lived “create tokens” token kept in the macOS Keychain, and pipe them straight into gh secret set, so the value is never on screen.
  • DNS cutover order. To attach a custom domain to a Worker, you first delete the existing record pointing at the old host. In the gap between deleting and attaching, the domain doesn’t resolve, and resolvers cache that “no record” answer for up to 30 minutes. Do the two steps back to back, and do www too. I forgot www the first time.
  • Leave the auth DNS records alone. Clerk’s clerk. and accounts. CNAMEs need to stay DNS only (grey cloud) on Cloudflare.
  • Turn off workers.dev. Otherwise every site also lives at *.workers.dev as a duplicate public URL. With workers_dev: false, the site only answers on the custom domain.

Would I use Railway again?

Yes. If a project needs a real server, workers, a Postgres instance, or anything long-running, Railway is still one of the nicest ways to get it running. These three apps just didn’t need any of that, and serving static files from Cloudflare is the simplest setup that fits them.