From 74051b71bda939b4e0f29edf3d0eb9b149311ef8 Mon Sep 17 00:00:00 2001 From: Dax Date: Thu, 5 Nov 2026 16:51:35 -0500 Subject: [PATCH] fix(web): route /docs with a query string to the v1 docs worker (#62195) --- infra/app.ts | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/infra/app.ts b/infra/app.ts index c6701797a4f..3a42f148485 100644 --- a/infra/app.ts +++ b/infra/app.ts @@ -27,17 +27,13 @@ const web = new sst.cloudflare.x.Astro("Web", { }, }) -// The site serves itself under /docs, so these routes take /docs on the main host. `sst dev` deploys no Worker. +// The site serves itself under /docs, so this route takes /docs on the main host. An exact `/docs` pattern misses +// `/docs?query`, so it's a `/docs*` prefix. `sst dev` deploys no Worker. const webServer = web.nodes.server if (webServer) { - for (const [name, pattern] of [ - ["WebDocsRoute", `${domain}/docs`], - ["WebDocsPathRoute", `${domain}/docs/*`], - ]) { - new cloudflare.WorkersRoute(name, { - zoneId: zoneID, - pattern, - script: webServer.nodes.worker.scriptName, - }) - } + new cloudflare.WorkersRoute("WebDocsRoute", { + zoneId: zoneID, + pattern: `${domain}/docs*`, + script: webServer.nodes.worker.scriptName, + }) }