-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Milestone
Description
Describe the problem
I have a project with a following pages routes structure:
/routes/index.svelte
/routes/posts/index.svelte
/routes/posts/index.json.js
/routes/posts/category1/index.svelte
/routes/posts/category2/index.svelte
/routes/posts/[...catchall]/index.json.js
/routes/posts/[...catchall]/index.svelte
What I am doing there:
/routes/posts/index.{svelte,json.js}is a list page with every post/routes/posts/category*/**/*.svelteare posts with just markup and some props/routes/posts/[...catchall]/index.sveltefires when no post if found, so it queries/routes/posts/[...catchall]/index.json.jsto check if the post has an alias and redirects
What I would like to do is to add a generic /likes.json endpoint to all the posts, so:
...
/routes/posts/[...catchall]/likes.json.js
/routes/posts/[...catchall]/index.svelte
/routes/posts/[...catchall]/index.svelte
But the problem I am facing is that the request is routed to the /routes/posts/[...catchall]/index.svelte handler, even though according to sorting rules, likes.json must have a priority
Describe the proposed solution
Support catchall suffixes
Alternatives considered
I could solve this without having [...rest] matcher of course, but that involves either copy-paste, or manual routing.
Importance
would make my life easier
Additional Information
This seems like an improvement of an existing feature
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp2-nice-to-haveSvelteKit cannot be used by a small number of people, quality of life improvements, etc.SvelteKit cannot be used by a small number of people, quality of life improvements, etc.