-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Include example of multiple base URLs used with VueAxios #127
Comments
Hmm, in my opinion, this is handled at a different level. There is a tool called NGINX (engine x) which supports implementing a reverse proxy. The question is probably why you want to do this?
You can find the official Basically what it is doing: Source API ~> Local URL To make a request to This setup was used in every organization I have worked with (@3YOURMIND and @klarna). I hope this makes it a bit more clear. Unfortunately, this app is just the "frontend" and it would not work to create a NGINX here. You can find a good explanation and step-by-step guide here: https://gist.github.com/soheilhy/8b94347ff8336d971ad0 I will leave this issue open if you have more questions :) Otherwise, I will close it in a week. |
@igeligel Ok, that's a great answer thanks. Embarassingly, I didn't know about this approach, as I've never needed to call multiple APIs before. Our stack is hosted on IIS, but it looks like reverse proxy is possible. I guess the only downside I can see is the extra configuration you need to add/change for the various APIs, rather than just including them in a vue environment config. |
Also, just looking how would you configure the webpack server to implement this? |
That's no problem that you did not know about this approach. It is good that you ask those questions 👍 Shows that you are willing to learn :)
yes and no. You need to this anyway. In the frontend or the Reverse Proxy. So you have to do it either way.
I answered this question once on stackoverflow: https://stackoverflow.com/questions/42748397/how-to-add-a-backend-to-the-webpack-template/42748740#42748740 You can also consult the official documentation here: https://cli.vuejs.org/config/#devserver-proxy |
Many real world apps use more than one API to grab data. Could an example of this be included in this app?
The text was updated successfully, but these errors were encountered: