mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-15 12:41:37 +03:00
feat(console): redirect old site pages to the console (#61108)
This commit is contained in:
@@ -44,5 +44,22 @@ export default createMiddleware({
|
||||
status: 302,
|
||||
headers: { Location: "https://opencode.ai/console/login", "Cache-Control": "no-store" },
|
||||
})
|
||||
|
||||
// The Go, Zen, pricing, models and teams pages moved to the Console. Match the exact paths only: /zen/v1/* and
|
||||
// /zen/go/v1/* are the inference API, so a prefix match here would break API clients if the inference routes ever
|
||||
// stopped catching them.
|
||||
const moved = new Map([
|
||||
["/go", "/console/go"],
|
||||
["/zen", "/console/models"],
|
||||
["/zen/go", "/console/go"],
|
||||
["/pricing", "/console/go"],
|
||||
["/models", "/console/models"],
|
||||
["/teams", "/console/teams"],
|
||||
]).get(url.pathname.replace(/(.)\/$/, "$1"))
|
||||
if (moved && !locale && (event.request.method === "GET" || event.request.method === "HEAD"))
|
||||
return new Response(null, {
|
||||
status: 302,
|
||||
headers: { Location: `${moved}${url.search}`, "Cache-Control": "no-store" },
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user