Skip to content

[Feature] Server API proxy #363

Open
@manchenkoff

Description

@manchenkoff

Is your feature request related to a problem? Please describe.

A lot of people prefer using routeRules to proxy their Nuxt requests to the remote API, but usually it has problems with passing headers/cookies and can result in unexpected behaviour.

Describe the solution you'd like

It would be nice to provide a collection of Nuxt server API routes that can be used instead of the remote server to handle this with full support of CSRF/Headers/cookies and other parameters to pass it from the client request and then back from the Laravel API.

It can be just one single route that proxies everything. However, that requires proper testing with different scenarios and possible user customisation.

This configuration should be optional since it won't work for CSR-only applications. Probably, we can reuse an approach used for globalMiddleware, which is not loaded if not enabled in the config.

Describe alternatives you've considered

Provide a complete guide on the usage of routeRules with a remote server.

Additional context

Related to:

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions