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
This commit is contained in:
Kimmo Puputti 2017-01-05 15:33:01 +02:00
parent 4c554fea50
commit f6755882f1
2 changed files with 23 additions and 2 deletions

View file

@ -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

View file

@ -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"
}
}