This is simple "Hello World!" application for demonstration how server-side rendering works with nodejs / react / redux
NOTE: all instructions below are for Ubuntu OS.
- clone repository
git clone https://github.com/mmaksymovych/isomorphic-application-example.git
- go to project root folder
- install packages
npm install
server side rendering doesn't work in development server, yes, it should be improved.
- run dev server by simply executing
npm run dev
IMPORTANT:
Production application is running on :80 port. On Ubuntu systems this port is blocked.
Before executing scripts below you should switch to the superuser mode i.e.sudo su
- build prod server sources by executing
npm run buildProd
- run application with nodemon by executing
npm run nodemonProd
After this your application will be served on yourhost:80
You can see this application already up and running by following link http://104.131.119.140/
Go to http://104.131.119.140/ to see content rendered by client.
Go to http://104.131.119.140/server to see content rendered by server.
As you can see client-side and server-side rendered content is the same.
Below you can find snapshots how google bot see the application.
client-side rendering
https://drive.google.com/open?id=0B-eeZzBP0CP0MzRBUlRQNUVTWkk
server-side rendering
https://drive.google.com/open?id=0B-eeZzBP0CP0QTAxSUVnRURpRG8
Resources