Nitro plugin to rewrite redirect responses so they can be handled client-side #142
mattmess1221
started this conversation in
Show and tell
Replies: 1 comment
-
|
@mattmess1221 What about adding it to the docs or adding an new top-level folder |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Plugin implementation of #139, feel free to use.
You may want to handle api redirects on the client for various reasons. My reason is so I can customize the caching logic.
To enable redirect rewriting, set
apiParty.experimental.enablePrefixedProxy = truein yournuxt.configand add the below nitro plugin.Then in your API composable, set the header
'X-Proxy-Redirect': 'manual'.app/composables/foo.tsserver/plugins/rewrite-api-redirects.tsBeta Was this translation helpful? Give feedback.
All reactions