• Resolved pixelsee

    (@pixelsee)


    Hello,

    I’m enjoying your plugin but I’m having some trouble with making external API calls using axios. When I run my application in development mode or build it outside of WordPress, everything works smoothly. However, when I try to build it within the WordPress environment, I encounter CORS issues that prevent me from retrieving any data. I’m not sure what’s causing this. Could you help me figure it out? I can share my code if that would be helpful.

    Thanks a lot!

    Best regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author rockiger

    (@rockiger)

    This is a WordPress-specific issue. Depending on how you authenticate to the WordPress-API and your server configuration.

    Do you host ReactPress and WordPress on the same domain? I remember that there is a plugin for disabling CORS in WordPress, but it is not hosting in the plugin directory.

    Thread Starter pixelsee

    (@pixelsee)

    Thanks for your response. I am using an external API, not connected to WordPress in any way. I will look into that plugin. I want to host it on the same domain. Is there a way to do it on different domains and still use react press? Like root.com and react.root.com? Thanks

    Plugin Author rockiger

    (@rockiger)

    No, it is not supported, I was just wondering.

    Thread Starter pixelsee

    (@pixelsee)

    Okay but fetching other apis should be working correct? I did not see an example in the docs

    Plugin Author rockiger

    (@rockiger)

    Sure, it’s an normal React app, that can use any API available. Only the React app itself needs to be hosted in youin yourr in your WordPress environment. That is the main point of the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘CORS’ is closed to new replies.