firasd / react-server-tutorial

Code from the React tutorial, modified to add Server-Side Rendering, React Router, and Redux.
https://medium.com/@firasd/quick-start-tutorial-universal-react-with-server-side-rendering-76fe5363d6e
Other
74 stars 14 forks source link

Deploy

React Server Tutorial

This is a modified version of the React comment box example from the React tutorial. The example app has been modified to add Server-Side Rendering, React Router, and Redux.

To use

The Node.js app serves static files from public/ and handles requests to /api/comments to fetch or add data. Start a server with:

npm install
node server.js

And visit http://localhost:3000/. Try opening multiple tabs!

Changing the port

You can change the port number by setting the $PORT environment variable before invoking the script, e.g.,

PORT=3001 node server.js