Question regarding SWR for unusual "proxy" scenario. #1512
Unanswered
aboveyunhai
asked this question in
Q&A
Replies: 1 comment 3 replies
-
You can surely do this, but I'm curious about the reason behind it. Mind sharing why you add this proxy layer? Also SWR is not comparable to something like Axios, they can be used together. |
Beta Was this translation helpful? Give feedback.
3 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.
-
As far as how I understand SWR, it's work pretty neat with direct communication.
But I wonder what happen if SWR can only contact with a "pseudo" proxy middleware.
For example,
SWR
->next.js Api
->next.js Api
will use (For example)axios
callremote backend Api
, the data from backend Api will be passed all the way back to client side via next.js Api.Assume we cannot directly call remote backend Api via SWR.
Will this still make SWR viable comparing to regular fetching api like
axios
.Beta Was this translation helpful? Give feedback.
All reactions