Skip to content

Serve trybilly.tech from the billy Worker - #50

Merged
vedantlavale merged 2 commits into
mainfrom
chore/cloudflare-hosting
Oct 18, 2026
Merged

vedantlavale merged 2 commits into
mainfrom
chore/cloudflare-hosting

Conversation

@vedantlavale

@vedantlavale vedantlavale commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Moves production serving from Vercel to the billy Worker, which already serves the full static export on billy.vedantlavale.workers.dev. wrangler.jsonc gains a routes block for trybilly.tech/* and www.trybilly.tech/*, so at deploy both hostnames are answered by the Worker and requests stop reaching the Vercel origin. No code changes.

Vercel stays as the pull-request preview builder and as a hot standby: its production domains are left attached, so rollback is removing the routes block and redeploying.

Why now

The /mcp endpoint in #49 needs the Worker on the real hostname for /connect to hand out a working address. trybilly.tech/mcp is 404 on Vercel, and a static export cannot serve it.

Evidence

Before: curl -sI https://www.trybilly.tech/ carries x-vercel-id (the Vercel origin); the Worker answers only on workers.dev.

On this branch (pre-merge):

  • wrangler deploy --dry-run: reads 143 asset files, exits clean.
  • Zone check: trybilly.tech (zone 88006387838f8deb71d9d94a5ff8041a) is in the Worker's account (98f49cad1636a4072e05b3b76d526bbe), so the routes resolve.
  • Local wrangler dev (port 8790): / 200, /editor 200, /early-birds 200, unknown path 404, _headers applied (x-frame-options: DENY).
  • Version upload, no traffic change: https://46135d16-billy.vedantlavale.workers.dev serves / 200, /editor 200, /early-birds 200, the 404 page, and the headers.

After merge:

One unknown that only shows at merge: whether the Workers Builds deploy token may manage zone routes. If the main build fails on that, I attach the routes with a local wrangler deploy (this token has workers_routes: write).

After merge (dashboard, optional)

The apex 308 to www was Vercel's. To keep it, add one Redirect Rule: zone trybilly.tech -> Rules -> Redirect Rules -> http.host eq "trybilly.tech" -> redirect to https://www.trybilly.tech, keep path and query, 308. Without it the apex serves the site directly. Steps in docs/deploy.md.

Checks

  • bun run build OK (7.3s).
  • (cd apps/web && bunx tsc --noEmit) clean.
  • (cd packages/invoice-core && bunx tsc --noEmit) only the known bun:test type noise.
  • (cd packages/invoice-core && bun test) 20 pass, 0 fail. The app has no tests.
  • bun run lint: the documented baseline error in apps/web/scripts/download-fonts.ts (no-explicit-any) plus 5 pre-existing warnings; this PR adds none.

Review note

Touches wrangler.jsonc and AGENTS.md, which #49 also edits in different regions. Whichever merges second needs a small rebase; I handle it. No issue to close.

Summary by CodeRabbit

  • Documentation
    • Updated deployment guidance to describe Cloudflare Workers as the production host and Vercel as the provider for pull-request previews.
    • Added instructions for deployment, hostname routing, redirects, and rollback.
  • Configuration
    • Routed the production domains to the Cloudflare Worker.

The Worker already serves the whole static export on workers.dev. A routes block points trybilly.tech and www.trybilly.tech at it, so requests stop reaching the Vercel origin; the apex-to-www redirect moves to a dashboard Redirect Rule. docs/deploy.md covers the pipeline, the rule and rollback.
Workers Builds builds and deploys main, wrangler.jsonc routes the two production hostnames, and docs/deploy.md documents the dashboard steps and rollback.
@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
billy Ready Ready Preview Oct 18, 2026 2:09pm UTC

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1d94aaaa-0654-408f-bb45-d059ef7e7333
📥 Commits

Reviewing files that changed from the base of the PR and between a490621 and 8153a6a.

📒 Files selected for processing: 4
  • AGENTS.md
  • README.md
  • docs/deploy.md
  • wrangler.jsonc
+--------------------------------+
| My GPUs mine bugs, not Crypto. |
+--------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@vedantlavale
vedantlavale merged commit 7a29708 into main Oct 18, 2026
2 of 5 checks passed

This branch was successfully deployed

1 active deployment
Preview — 8153a6a0 Deployed Oct 18, 2026 by vercel[bot]
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