🏠 Homepage
-
npm >=5.5.0
-
node >=9.3.0
Install both client and server dependencies
# Install dependencies for server
$ npm install
# Install dependencies for client
$ npm run client-install
1. Create a nodemon.json file in project root dir
$ touch nodemon.json
2. Feed values to the file like this -
{
"env": {
"mongoURI": "",
"baseUrl": "http://localhost:5000",
"NODE_ENV": "development"
}
}
ℹ️ To get the mongoURI, you can install MongoDB locally , use MongoDB Atlas or simply use MLab.
# Run the client & server with concurrently
$ npm run dev
# Run the Express server only
$ npm run server
# Run the React client only
$ npm run client
# Server runs on http://localhost:5000 and client on http://localhost:3000
There is a Heroku post build script so that you don't have to compile your React frontend manually, it is done on the server. Simply push to Heroku and it will build and load the client index.html page