FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Running into CORS error · Issue #91 · pajaydev/ebay-node-api · GitHub

Repository navigation

Running into CORS error #91

Open
Open

Description

from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

I was wondering how to fix this error for the Search by keyword API

Activity

  1. pajaydev commented on May 14, 2020

    Owner

    @Anand-Issac Kindly provide me more context how are you trying to access the library. Are you using in server-side or client-side using AJAX calls ?.

    If server side, are u using express js ?.

  2. Anand-Issac commented on May 16, 2020

    Author

    I was using an AJAX call, the fetch API in react to use the ebay Finding API. I set a proxy in my package.json to solve the CORS issue but now I face a problem that after I deploy the application using Firebase Hosting, the API call returns an index.html response instead of the JSON response I got in my localhost server. I was wondering why this was so and if there is any solution to this ?

  3. pajaydev commented on May 16, 2020

    Owner

    @Anand-Issac Ohh that's weird. Is there any URL or github link, I can check ?.

  4. Anand-Issac commented on May 16, 2020

    Author
  5. pajaydev commented on May 16, 2020

    Owner

    Cool. I will take a look

  6. Anand-Issac commented on May 18, 2020

    Author

    @pajaydev Hey man. Did you figure out the problem yet?

  7. pajaydev commented on May 18, 2020

    Owner

    @Anand-Issac Sorry was stuck in some other things, will look it up tonight

  8. pajaydev commented on May 18, 2020

    Owner

    @Anand-Issac I can see its working fine in local (both read and write data from firebase).
    if I am not wrong, you are facing issue after deploying. Kindly share me the URL where you have deployed the code.

  9. Anand-Issac commented on May 18, 2020

    Author
  10. Anand-Issac commented on May 18, 2020

    Author

    If you try to request ebay API now on deployed app it will return a HTML file (my index.html) instead of the proper JSON response. It still says Status 200 though ... I'm not exactly sure why this happens

  11. pajaydev commented on May 19, 2020

    Owner

    @Anand-Issac sure I will take a look. Thanks

  12. pajaydev commented on May 20, 2020

    Owner

    @Anand-Issac I made a simple proxy using express JS to call this library.

    Kindly take a look at it.

    https://gist.github.com/pajaydev/b10b4d29bae85b441954d298a9e0d2c3

    I would do like this to set up a simple proxy. Let me know if you face any issue.
    Hope it helps.

  13. Anand-Issac commented on May 20, 2020

    Author
  14. Anand-Issac commented on May 24, 2020

    Author

    Hey @pajaydev Sorry for the long response time. I had a lot of school work to do.

    Okay so I implemented your solution. The problem is. When I run in my local server the response says 200 but it returns me my own HTML page as a response instead of the JSON data I would like

    Can you please take a look?
    https://github.com/Anand-Issac/shopping-cart

    Here is the repo .

    Thanks

  15. pajaydev commented on May 27, 2020

    Owner

    I will take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL