I am having quite an issue at the moment. In order to have the OpenGraph images, I have to use prerender.io.

I tried with Apache, but it just doesn’t work since I couldn’t change the Apache configuration. So, anyway, I switched to a Express “app” that will route all requests to the React build.

I put one .htaccess in the /build folder and it contains this: https://pastebin.com/9J2c0UX6

As for the app.js, here is the config: https://pastebin.com/ZyRNPLie

I tried putting .htaccess in both the build folder and at the same level as app.js, but it doesn’t work (white page because I can’t import the script, it imports index.html instead.)

I really don’t know what to do to make this work… I am horrible with Apache and Express haha

r/webdev - React app with Express Router either gives blank page or can't refresh/write manually

files structure

Source link

Write A Comment