-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Catch-all route #1064
Comments
You can use a Depending on your setup, you might need to set it after other routes that share the same resource. Just be cautious that this kind of wildcard routes (or ones that comes out from a Regex) are expensive in terms of performance |
Where would I put that, let's say in the context of the vue-kitchensink example? I tried altering the param regex to allow wildcards, e.g. naming a file [*].vue. But it doesn't seem to work, perhaps because the vue router expects |
Sorry, for that I'm clueless; not really sure how they work 🙁 |
For a workaround I changed the param pattern to allow + at the end viteFastifyVue({ paramPattern: /\[([\w]+\+?)\]/ }), I named my file server.addHook("onRoute", (route) => {
route.url = route.url.replace(/\:[^\+]+\+/, "*");
}); |
💬 Question here
Is it possible to add a catch-all route like: https://nextjs.org/docs/pages/building-your-application/routing/dynamic-routes#catch-all-segments
E.g.
/categories/[...slug]
would match/categories/1
and/categories/1/2
Your Environment
fastify/vite & fastify/vue
The text was updated successfully, but these errors were encountered: