We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
/api-routes
/server-routes
1 parent 085bb1d commit ba7a9e8Copy full SHA for ba7a9e8
1 file changed
src/libraries/start.tsx
@@ -5,6 +5,7 @@ import { BiBookAlt } from 'react-icons/bi'
5
import { PiRocketLaunchDuotone, PiTreeStructureBold } from 'react-icons/pi'
6
import { TbServerBolt } from 'react-icons/tb'
7
import { twMerge } from 'tailwind-merge'
8
+import { redirect } from '@tanstack/react-router'
9
10
const repo = 'tanstack/router'
11
@@ -150,4 +151,16 @@ export const startProject = {
150
151
),
152
},
153
],
154
+ handleRedirects: (href) => {
155
+ // Redirect from /api-routes to /server-routes
156
+ if (
157
+ href.match(
158
+ /\/start\/(latest|v1)\/docs\/framework\/(react|solid)\/api-routes/
159
+ )
160
+ ) {
161
+ throw redirect({
162
+ href: href.replace('/api-routes', '/server-routes'),
163
+ })
164
+ }
165
+ },
166
} satisfies Library
0 commit comments