Skip to content

fix(landing): 404 unknown paths instead of serving the landing page - #193

Open
Rumblingb wants to merge 1 commit into
codex/founder-orchestration-2026-07-11from
fix/landing-routing-404-pr
Open

fix(landing): 404 unknown paths instead of serving the landing page#193
Rumblingb wants to merge 1 commit into
codex/founder-orchestration-2026-07-11from
fix/landing-routing-404-pr

Conversation

@Rumblingb

Copy link
Copy Markdown
Owner

What

handleRequest ended in a catch-all that returned the landing page with HTTP 200 for every unmatched path. This serves the landing page only at / and /index.html; everything else returns the existing renderNotFoundPage at 404.

Adds verify-routing.mjs (public verification gate) and deploy-routing-fix.sh (rollback-protected deploy, modelled on deploy-postizzz-review.sh).

Why it matters

A dead route was byte-identical to a live one. That is precisely how the stale deployment of /awesome-free-dev-tools/buy went unnoticed — and it lets crawlers index unlimited duplicate copies of the landing page.

Verified against live production right now: /awesome-free-dev-tools/buy returns 200 with no Location header. Clicking buy serves the landing page instead of Stripe. The checkout path is currently dead in production.

Note the code for that redirect is already correct on this branch and covered by a passing test — the live Worker is simply stale. This PR does not fix that on its own; the deploy does.

Verification

  • node --test worker.test.mjs → 1/1 pass
  • node --check worker.js → clean
  • wrangler deploy --strict --dry-run → builds, 66.86 KiB / 17.60 KiB gzip
  • verify-routing.mjs against live production → fails on exactly the 4 broken routes, passes the 9 healthy ones

Routing table after the change:

path status
/, /index.html 200 landing
/awesome-free-dev-tools, /terms, /privacy, /postizzz, /rank/<agent>, /health 200 unchanged
/awesome-free-dev-tools/buy 302 → buy.stripe.com
anything else 404 + noindex

Base branch

Targets codex/founder-orchestration-2026-07-11, not main — the landing worker does not exist on main (0 files there). Cherry-picked onto the pushed codex tip 3623a199 so this PR contains exactly one commit; the 7 locally-unpushed commits on that branch are deliberately not included.

Deploy note

deploy-routing-fix.sh guards Node >= 22, which wrangler 4.x requires and the repo's default 20.18.0 does not meet — the existing deploy script would fail there.

🤖 Generated with Claude Code

handleRequest ended in a catch-all that returned the landing page with
HTTP 200 for every unmatched path. That hid broken links — a dead route
was byte-identical to a live one, which is how the stale deployment of
/awesome-free-dev-tools/buy went unnoticed — and let crawlers index
unlimited duplicate copies of the landing page.

Serve the landing page only at / and /index.html; everything else gets
the existing renderNotFoundPage at status 404. renderNotFoundPage takes
an optional hint so it can be reused outside the AgentRank path without
claiming the visitor mistyped an agent identifier.

Adds regression coverage for the 404 behaviour, plus verify-routing.mjs
(public gate asserting known routes still 200, /buy still 302s to
Stripe, and unknown paths 404) and deploy-routing-fix.sh, which records
the current 100%-traffic version and rolls back automatically if that
verification fails. The deploy script also guards Node >=22, which
wrangler 4.x requires and this repo's default 20.18.0 does not meet.

Verified: node --test 1/1 pass, node --check clean, wrangler
--dry-run builds (66.86 KiB), and verify-routing.mjs run against live
production fails on exactly the four broken routes while passing the
nine healthy ones.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agentpay-dashboard Error Error Jul 27, 2026 9:54am
agentpay-docs Error Error Jul 27, 2026 9:54am
agentpay-host-native-restore Ready Ready Preview, Comment Jul 27, 2026 9:54am

Copy link
Copy Markdown
Owner Author

Not merged — blocked by failing checks.

Commit 918f8b8: 2 of 3 status checks are red —

No merge conflict (mergeable_state: unstable is checks-only). This PR only touches workers/agentpay-landing/ — none of apps/docs or dashboard/ — so these two failures look pre-existing/unrelated to this diff rather than caused by it, but repo hygiene here is not to merge on red checks. Please confirm these are known-unrelated (or fix them) before merge; #195 stacks on this one and can't land until this does.


Generated by Claude Code

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