CORS error with AJAX filter

developerDan
Shopify Partner
2 0 0

Hi all,

 

I built a vue.js app to make an API call any time someone clicks on the filters for a collection. I'm getting a CORS error and I understand why, but what I want to know is how to solve it. I know I'm supposed to use a Shopify proxy app but honestly I'm quite lost when trying to set it up. I also don't know how that'll work in terms of the API call I'm making. Does that mean I have to change the url in the API call? Or will the proxy reroute it?

 

None of this is clear to me and I've spent the last day and a half trying to make heads or tails of the documentation on this but I feel like I'm stuck on the simple parts of setting it up and connecting it to my store. I get the app in the Partners page but I don't know where to get a proxy server or what to do when I have one to make sure it's work

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1363 228 476

Hi developerDan,

 

If the [App Proxy info in the Dev Docs] isn't helping maybe [this article on Medium] will be useful as it describes App Proxies in a slightly different way.

 

One thing that comes to mind to ask about is what sort of API call you're intending to make and having trouble with, as generally the App Proxy is used to route calls to an external server as opposed to directly making API calls to a store's internal resources.

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog