React Sync Demo
This is a modified version of the React comment box example from the React tutorial . The example app has been modified to demonstrate syncing updates and offline activity across devices.
Start the server with:
npm install node server.js
And visit http://localhost:3000/ . Try opening multiple tabs!
You can change the port number by setting the
$PORT environment variable before invoking the script, e.g.,
PORT=3001 node server.js
Primus is set to create a new
public/scripts/primus.js file when the server starts. If you’re using nodemon to restart on file changes:
nodemon --ignore public --ignore comments.json
Webpack config in
webpack.config.js runs DefinePlugin to set NODE_ENV to production, and UglifyJS to minify files. Comment out the plugins, then run webpack: