Skip to content
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

Open
3 of 4 tasks
manniL opened this issue May 8, 2024 · 4 comments
Open
3 of 4 tasks

Allow server routes to defer back to the Nuxt renderer #27105

manniL opened this issue May 8, 2024 · 4 comments

Comments

@manniL
Copy link
Member

manniL commented May 8, 2024

Describe the feature

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

Related:

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Copy link
Member

cc: @pi0

@pi0
Copy link
Member

pi0 commented May 8, 2024

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.

@danielroe danielroe added the discussion label May 8, 2024 — with Volta.net
@manniL
Copy link
Member Author

manniL commented May 12, 2024

Maybe that's something which should be documented then as recipe + pointing out when to use / when not use it?

@pi0
Copy link
Member

pi0 commented May 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants