fix: catch-all server side handler (#287)

This commit is contained in:
Valerio Ageno
2025-01-04 12:07:20 +01:00
committed by GitHub
parent 1356be248e
commit 91236e5533
3 changed files with 2 additions and 2 deletions
@@ -85,8 +85,7 @@ async function getRouteNodes(
} else if (fullPath.match(/\.(rs)$/)) { } else if (fullPath.match(/\.(rs)$/)) {
const filePath = replaceBackslash(path.join(dir, dirent.name)) const filePath = replaceBackslash(path.join(dir, dirent.name))
const filePathNoExt = removeExt(filePath) const filePathNoExt = removeExt(filePath)
let routePath = let routePath = cleanPath(`/${filePathNoExt}`) || ''
cleanPath(`/${filePathNoExt.split('.').join('/')}`) || ''
if (routePath === 'index') { if (routePath === 'index') {
routePath = '/' routePath = '/'
@@ -24,6 +24,7 @@ const IndexRoute = Index.update({
const PostscatchallRoute = Postscatchall.update({ const PostscatchallRoute = Postscatchall.update({
path: '/posts/[...catch_all]', path: '/posts/[...catch_all]',
getParentRoute: () => rootRoute, getParentRoute: () => rootRoute,
hasHandler: true,
}) })
// Create and export the route tree // Create and export the route tree