Skip to content

Commit c5df631

Browse files
committed
fix(start): redirect from api-routes to server-routes
1 parent 085bb1d commit c5df631

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libraries/start.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { BiBookAlt } from 'react-icons/bi'
55
import { PiRocketLaunchDuotone, PiTreeStructureBold } from 'react-icons/pi'
66
import { TbServerBolt } from 'react-icons/tb'
77
import { twMerge } from 'tailwind-merge'
8+
import { redirect } from '@tanstack/react-router'
89

910
const repo = 'tanstack/router'
1011

@@ -150,4 +151,13 @@ export const startProject = {
150151
),
151152
},
152153
],
154+
handleRedirects: (href) => {
155+
if (
156+
href.match(/\/start\/latest\/docs\/framework\/(react|solid)\/api-routes/)
157+
) {
158+
throw redirect({
159+
href: href.replace('/api-routes', '/server-routes'),
160+
})
161+
}
162+
},
153163
} satisfies Library

0 commit comments

Comments
 (0)