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
If you have the desire to write a server route which should only conditionally return values (think of accept header being set to application/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
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.
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: