From f6755882f18f7823d373f935c4bc808ecc6868fd Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Thu, 5 Jan 2017 15:33:01 +0200 Subject: [PATCH] Change server dev setup - `npm start` only starts the applications and requires that `npm run build` is already run - `npm run dev-server` runs the build and starts the server with nodemon - update README --- README.md | 22 +++++++++++++++++++++- package.json | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1158cd22..191d5710 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,32 @@ ## Getting started +Clone this repository and install dependencies: + yarn ## Development +To develop the application and to see changes live, start the frontend +development server: + npm run dev -## Server +## Development Server +To develop the server setup, run: + + npm run dev-server + +This runs the frontend production build and starts the Express.js +server in `server/index.js` that renders the application routes in the +server. The server is automatically restarted when there are changes +in the `server/` directory. + +Not that this server does **not** pick up changes in the frontend +application code. + +## Production Server + + npm run build npm start diff --git a/package.json b/package.json index 087e44e7..bd087892 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject", - "start": "npm run build&&node server/index.js" + "start": "node server/index.js", + "dev-server": "npm run build&&nodemon --watch server server/index.js" } }