if (process.env.NODE_ENV === 'production') {
//Express will serve up production assets
//like our main.js file, or main.css file
app.use(express.static('client/build'));
//Express will serve up the index.html file
//if it doesn't recognize the route
//note 1: if it doesn't recognize the file being scanned above(static/client/build), then it will go through here to find the index.html file. This route is a catch-all scenario just to load the client app in express server.
const path = require('path');
app.get('*', (req, res) => {
res.sendfile(path.resolve(__dirname, 'client', 'build', 'index.html'));
});
}