Skip to content

Website: deploy to Cloudflare Workers instead of Netlify - #110

Closed
tuanphungcz wants to merge 1 commit into
mainfrom
cloudflare
Closed

tuanphungcz wants to merge 1 commit into
mainfrom
cloudflare

Conversation

@tuanphungcz

Copy link
Copy Markdown
Collaborator

useanimations.com moves from Netlify to Cloudflare Workers (static assets + a small Worker).

  • wrangler.jsonc: the Worker useanimations, assets from website/dist, custom domain useanimations.com.
  • website/worker.ts: replaces both Netlify edge functions (301s to canonical URLs, Markdown versions of pages for Accept: text/markdown). It runs only for page paths (run_worker_first); icon files come straight from the assets.
  • public/_headers and public/_redirects stay; Cloudflare reads the same format. The ! suffixes and the /icons rewrite are gone (Cloudflare serves icons.html at /icons itself).
  • CI: main deploys with wrangler deploy; every PR uploads a preview version under the alias pr-<number> and comments its URL.
  • www and react.useanimations.com redirect to the apex with a Redirect Rule on the zone.

The site goes live on Cloudflare once the domain's nameservers at the registrar are switched to apollo.ns.cloudflare.com and nola.ns.cloudflare.com.

The site is served as Worker static assets, which read public/_headers and public/_redirects as
before. website/worker.ts takes over both edge functions: the 301s to canonical URLs and the
Markdown versions of pages. CI deploys main with wrangler and uploads every PR as a preview
version under the alias pr-<number>.
@github-actions

Copy link
Copy Markdown

🔎 Website preview

https://pr-110-useanimations.tuan7822.workers.dev

Updated for commit 6297ee5.

@tuanphungcz

Copy link
Copy Markdown
Collaborator Author

Staying on Netlify: the domain's DNS stays at the registrar, which Cloudflare Workers can't serve without its nameservers.

@tuanphungcz
tuanphungcz deleted the cloudflare branch October 11, 2026 17:03

This branch was successfully deployed

1 active deployment
preview — 6297ee54 Deployed Oct 11, 2026 by tuanphungcz via preview #58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant