Good morning guys, I'm working on a vue project which makes a get request to an api on a different website using axios. Well, I encountered an error which reads, "No Access-control-allow-origin header" , so I did some research and I understand the browser is only blocking the request due to the Same origin policy implementation (which I understand now). So I got a quick fix which was to add a chrome extension which I think is cool for dev purposes, but my concern is when it gets to production, How I'm I going to fix this so that my clients wouldn't have to install this chrome extension.? Would i have to route the request through a proxy? If so kindly suggest some useful resources to help me out. And If my understanding of cors Is wrong, kindly help with some clarification, thanks. Using vue n laravel
Asked
Active
Viewed 29 times
0
-
If you can’t get the remote party to send the appropriate headers from their end to explicitly allow this - then yes, you will need to proxy the request. _“If so kindly suggest some useful resources to help me out.”_ - gladly; one of them is called _Google_ … (Seriously, you need to make a bit more of an effort.) – misorude Aug 28 '19 at 13:00
1 Answers
0
Would i have to route the request through a proxy?
If the server you make the request to does not support CORS then, yes. CORS must be implemented by the server, so in your case the API of that "different website". If it does not routing it through a proxy, so your server, is the only way.

Lux
- 17,835
- 5
- 43
- 73