Closed AdditionAddict closed 1 year ago
Intended PR after '## Route Metadata' section and code
To redirect to the route /dashboard from /, define redirectTo and pathMatch inside src/app/routes/index.ts:
/dashboard
/
redirectTo
pathMatch
src/app/routes/index.ts
import { RouteMeta } from '@analogjs/router'; export const routeMeta: RouteMeta = { redirectTo: '/dashboard', pathMatch: 'full', };
Or is there a preference to keep using parenthesis index route like src/app/routes/(redirect).ts?
src/app/routes/(redirect).ts
Interesting convention around the (redirect).ts. I think the index.ts would be clearer, as you don't have to name it (redirect) for it to work
(redirect).ts
index.ts
(redirect)
Intended PR after '## Route Metadata' section and code
Redirect to a default route
To redirect to the route
/dashboard
from/
, defineredirectTo
andpathMatch
insidesrc/app/routes/index.ts
:Or is there a preference to keep using parenthesis index route like
src/app/routes/(redirect).ts
?