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
Allow server
routes to defer back to the Nuxt renderer
#27105
Comments
cc: @pi0 |
This is similar to server action support. If needed, I suggest registering a passthrough router in a middleware however I would strongly advise approaching it as an opt-in module (for use-cases really need overlapping routes) rather than built-in feature because of additional to middleware complexities it adds and one route acting differently. |
Maybe that's something which should be documented then as recipe + pointing out when to use / when not use it? |
Since this is a diverged usage/behavior (not a configured usage), I would suggest using a module that can both document and at least try to handle edge cases better. |
Describe the feature
If you have the desire to write a
server
route which should only conditionally return values (think ofaccept
header being set toapplication/json
) and otherwise let Nuxt render the route, it isn't straightforward to do so.Having a way to "defer back to the Nuxt renderer", ideally as "default" behavior when not returning a value or when calling a specific method would be helpful
Related:
Additional information
Final checks
The text was updated successfully, but these errors were encountered: