1,012 B
1,012 B
Routing
Adding a New Route
Both steps are required — skipping step 1 causes a silent 404.
-
Register in
app/routes.ts(do this first):route("admin/sports-seasons/:id/new-page", "routes/admin.sports-seasons.$id.new-page.tsx")Nested admin routes go inside the
route("admin", ...)array. -
Create the file in
app/routes/with the matching name. -
Export
loader/actionas needed. TypeScript types are auto-generated viareact-router typegen.
File Naming Conventions
.separates path segments:leagues.$leagueId.settings.tsx→/leagues/:leagueId/settings$param= dynamic segment_index.tsx= index route for a path
Admin Routes
All admin routes are nested under /admin and require isAdmin: true on the user:
| Prefix | Area |
|---|---|
admin.sports.* |
Sports management |
admin.sports-seasons.* |
Sports seasons |
admin.templates.* |
Season templates |
admin.data-sync.tsx |
Data sync utilities |