• Resolved jtesting

    (@jtesting)


    Hello, is it possible to use proxy-server with reactpress? I have setupProxy.js file that works fine locally when I fetch localhost:3000/api . However, when I place the build folder on my wordpress site this fails. What would be the correct way to access this endpoint?

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

    (@rockiger)

    You probably need to configure the proxy server differently. ReactPress changes the PUBLIC_URL environment variable in package.json, maybe this needs to be accounted for.

    Thread Starter jtesting

    (@jtesting)

    Ah yes I do see that in the package.json. Taking that into account I updated the code to

    let url = ${process.env.REACT_APP_PUBLIC_URL}/api;

        fetch(url)

    However, the request gets sent to which does not exist…
    https://(wordpress_site_domain)/wp-content/reactpress/apps/demo/build/api

    Any other possible tips?

    Plugin Author rockiger

    (@rockiger)

    Proxy configurations are not my area of expertise. Maybe activate client-side routing. Otherwise, WordPress will ‘catch’ that route.

    Thread Starter jtesting

    (@jtesting)

    I will give that a try thank you. Also any new updates on the progress towards Vite?

    Plugin Author rockiger

    (@rockiger)

    Vite works now. If you follow the docs.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Proxy-Server?’ is closed to new replies.