t3chnoboy / amazon-product-api

:credit_card: Amazon Product Advertising API client
366 stars 104 forks source link

Add query for proxy server #98

Closed sorensenjg closed 7 years ago

sorensenjg commented 7 years ago

@masterT I'm not entirely sure.. I am using amazon-product-api in a react app and i have been banging my head against the desk for the last day or two trying to figure out why my get request was getting a CORS error. I discovered that the use of a proxy server was necessary, however there was no way of adding this to the request directly. Do you have an better/alternative way to implement this? If so, please share an example. Thanks!

masterT commented 7 years ago

You should use the library on the server side.

sorensenjg commented 7 years ago

@masterT Would you mind explaining why it should be used on the server side? I am using this to query and display products based on user submitted input field values, in real-time. Maybe @t3chnoboy can chime in?

masterT commented 7 years ago

It would expose your API secret if you use it from the browser.

sorensenjg commented 7 years ago

Got it! I knew i was missing something really obvious.. Thanks