diff --git a/react-ui/src/App.js b/react-ui/src/App.js index 7e261ca..4e182e5 100644 --- a/react-ui/src/App.js +++ b/react-ui/src/App.js @@ -8,17 +8,34 @@ class App extends Component {
logo -

- Edit src/App.js and save to reload. -

- - Learn React - + { process.env.NODE_ENV === 'production' ? + +

+ This is a production build from create-react-app +
+
+ + React + Node deployment on Heroku + +

+ + :

+ Edit src/App.js and save to reload. +
+
+ + Learn React + +

+ }
); diff --git a/server/index.js b/server/index.js index 986b37d..9b5c7d6 100644 --- a/server/index.js +++ b/server/index.js @@ -3,10 +3,11 @@ const path = require('path'); const cluster = require('cluster'); const numCPUs = require('os').cpus().length; +const isDev = process.env.NODE_ENV !== 'production'; const PORT = process.env.PORT || 5000; // Multi-process to utilize all CPU cores. -if (cluster.isMaster) { +if (!isDev && cluster.isMaster) { console.error(`Node cluster master ${process.pid} is running`); // Fork workers. @@ -36,6 +37,6 @@ if (cluster.isMaster) { }); app.listen(PORT, function () { - console.error(`Node cluster worker ${process.pid}: listening on port ${PORT}`); + console.error(`Node ${isDev ? 'dev server' : 'cluster worker '+process.pid}: listening on port ${PORT}`); }); }