You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/docs/01-routing.md
+3-44Lines changed: 3 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -323,11 +323,10 @@ A route can have multiple dynamic parameters, for example `src/routes/[category]
323
323
It's possible for multiple routes to match a given path. For example each of these routes would match `/foo-abc`:
324
324
325
325
```bash
326
+
src/routes/[...catchall].svelte
326
327
src/routes/[a].js
327
328
src/routes/[b].svelte
328
-
src/routes/[c].svelte
329
-
src/routes/[...catchall].svelte
330
-
src/routes/foo-[bar].svelte
329
+
src/routes/foo-[c].svelte
331
330
```
332
331
333
332
SvelteKit needs to know which route is being requested. To do so, it sorts them according to the following rules...
@@ -340,48 +339,8 @@ SvelteKit needs to know which route is being requested. To do so, it sorts them
340
339
...resulting in this ordering, meaning that `/foo-abc` will invoke `src/routes/foo-[bar].svelte` rather than a less specific route:
341
340
342
341
```bash
343
-
src/routes/foo-[bar].svelte
342
+
src/routes/foo-[c].svelte
344
343
src/routes/[a].js
345
344
src/routes/[b].svelte
346
-
src/routes/[c].svelte
347
345
src/routes/[...catchall].svelte
348
346
```
349
-
350
-
#### Fallthrough routes
351
-
352
-
In rare cases, the ordering above might not be what you want for a given path. For example, perhaps `/foo-abc` should resolve to `src/routes/foo-[bar].svelte`, but `/foo-def` should resolve to `src/routes/[b].svelte`.
353
-
354
-
Higher priority routes can _fall through_ to lower priority routes by returning `{ fallthrough: true }`, either from `load` (for pages) or a request handler (for endpoints):
0 commit comments