Skip to content

Serve the docs at morse-ai.com and www - #2

Merged
CodyEngel merged 1 commit into
mainfrom
claude/astro-starlight-docs-site-64gaca
Aug 12, 2026
Merged

Serve the docs at morse-ai.com and www#2
CodyEngel merged 1 commit into
mainfrom
claude/astro-starlight-docs-site-64gaca

Conversation

@CodyEngel

Copy link
Copy Markdown
Owner

Follow-up to #1. Two lines of config, now that the Worker exists and deploys cleanly.

"routes": [
  { "pattern": "morse-ai.com", "custom_domain": true },
  { "pattern": "www.morse-ai.com", "custom_domain": true }
]

custom_domain means wrangler creates the DNS records and provisions the certificates on the next deploy — no dashboard step, and the config rather than a settings page is the record of where the site lives.

www is a second custom domain, not a redirect to the apex. A redirect is a zone-level rule and wrangler has no say in one, so declaring it here would not have worked. Both hostnames serve the same build, and every page already emits <link rel="canonical"> on the apex (from site in site/astro.config.mjs), so they do not compete for the same page in search results. If you would rather www redirect than serve, that is a Redirect Rule on the zone and this route should come back out — say the word and I will.

workers_dev is left alone deliberately: the workers.dev URL stays useful for checking a deploy before DNS settles, and branch builds keep producing preview URLs through the same subdomain.

What to expect on merge

The push to main triggers a build, and wrangler deploy attaches both hostnames. Certificate issuance takes a few minutes, so an immediate https://morse-ai.com may show a TLS warning before it settles — that is the cert, not the deploy.

The one cost worth stating

This binds deploys to the zone. If morse-ai.com ever leaves that Cloudflare account, every deploy fails here — including one that was only a typo fix on a page — until the routes go with it. Recorded in CONTRIBUTING.md alongside the dashboard settings, since the failure would otherwise be baffling.

Verified

  • wrangler.jsonc parses with the comments stripped; routes is the shape wrangler expects
  • npx wrangler@4 deploy --dry-run — reads 80 files from site/dist, no config errors
  • npm run docs:build — 16 pages, 357 internal links, all resolve

I could not reach morse.codys-account-8c8.workers.dev to check the live deploy: this sandbox's egress policy blocks *.workers.dev with a 403 on the CONNECT tunnel. Everything above is verified against the config and the build output rather than the running site.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V8CHi3o1YanuKYvQzS1giK


Generated by Claude Code

Declared as custom domains in wrangler.jsonc rather than attached by
hand, so wrangler creates the DNS records and certificates on deploy and
the config, not a dashboard page, is the record of where the site lives.

www is a second custom domain rather than a redirect to the apex: a
redirect is a zone-level rule and wrangler has no say in one. Both
hostnames serve the same build, and every page already declares a
canonical URL on the apex, so they do not compete for the same page in
search results.

The cost is a coupling worth stating: morse-ai.com has to stay a zone on
this Cloudflare account. If it leaves, every deploy fails here — including
one that was only a typo fix on a page — until these routes go with it.

workers_dev is left alone, so the workers.dev URL keeps working for
checking a deploy before DNS settles, and branch builds keep producing
preview URLs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V8CHi3o1YanuKYvQzS1giK
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 12, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
morse 468380c Commit Preview URL

Branch Preview URL
Aug 12 2026, 09:27 PM

@CodyEngel
CodyEngel merged commit 990a505 into main Aug 12, 2026
10 checks passed
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.

2 participants