Support for spread operator in middleware matcher #42458
Replies: 10 comments
-
Yes, this would be great. Trying to transition a lot of old -> new routes for a redesign will be a bit tedious having to list them all out individually 😵 edit: I would add though for redirects, if that is your use case, the |
Beta Was this translation helpful? Give feedback.
-
Would be cool to have this, ran into it myself today. |
Beta Was this translation helpful? Give feedback.
-
+1 on this |
Beta Was this translation helpful? Give feedback.
-
+1 on this |
Beta Was this translation helpful? Give feedback.
-
Would it maybe even be stronger to enable multiple middlewares in a file-system based nested manner? This way, not only the spread operator is added, but several more things? |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
I would like to have support for the spread operator in the middlware matcher so that if I can use an array of paths instead of having to manually type them out.
Consider a use case like:
Currently the above example throws this error in the console:
Unsupported spread operator in the Array Expression at "config.matcher".
Describe the solution you'd like
Support for the spread operator in the matcher.
Describe alternatives you've considered
Writing out paths.
Beta Was this translation helpful? Give feedback.
All reactions