Skip to content

Instantly share code, notes, and snippets.

@davidvandusen
Last active April 8, 2018 02:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save davidvandusen/3712f109e82540a28de0b07a45e51ab5 to your computer and use it in GitHub Desktop.
Save davidvandusen/3712f109e82540a28de0b07a45e51ab5 to your computer and use it in GitHub Desktop.

This script will start both the WebpackDevServer and the production API server at the same time.

Run the script from the project root folder with:

./start.sh

They can be stopped at the same time by pressing CTRL + C.

The structure of the files should be:

project-folder/
├── client/
├── server/
└── start.sh

The client folder should contain the react-simple-boilerplate and the server folder should contain the production Node.js app that serves the API routes that the client application consumes. In the server app, there should be a script in the package.json called "local". It would be handy if this was defined as "nodemon server" and nodemon was listed in devDependencies.

#!/usr/bin/env bash
cd client/ ; npm start & cd ../server/ ; npm run local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment