mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-16 16:00:14 +00:00
feat(console): redirect old site pages to the console (#61108)
This commit is contained in:
parent
8c750e3750
commit
8bca532929
1 changed files with 17 additions and 0 deletions
|
|
@ -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" },
|
||||
})
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue