1. configure nginx config (or virtual host config) which is serving your local react (or any js framework) app via this official prerender.io nginx config:
https://gist.github.com/thoop/8165802
https://prerender.io/documentation/test-it
Note: if the server won't run because of missing chrome installed, then install it. On ubuntu follow this instructions:
https://www.ubuntuupdates.org/ppa/google_chrome?dist=stable -> the final command is sudo apt-get install google-chrome-stable
PORT=3009 node server.js
(or use pm2 with json config file)
4. change public prerender.io server for your local one, via editing of nginx conf of your app and replace this line:
set $prerender "service.prerender.io";
to this:
set $prerender "127.0.0.1:3009";
5. [BONUS] if you are using css-in-js library (emotion, styled-components) you need to turn off speedy mode to have css rendered. Example of the setup for emotion here:
https://github.com/emotion-js/emotion/blob/master/docs/ssr.md#puppeteer
- index example for render/hydrate: https://github.com/stereobooster/an-almost-static-stack/blob/react-snap/src/index.js
prerender.io documentation: https://prerender.io/documentation