From 8d76e419db7bb9054aaa3bc3435eed00ffc5dc5a Mon Sep 17 00:00:00 2001 From: Josua Amann Date: Wed, 22 Nov 2017 16:03:41 +0100 Subject: [PATCH] add script-shortcuts to `package.json` in root --- README.md | 9 ++++----- package.json | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5705ef3..8a85446 100644 --- a/README.md +++ b/README.md @@ -56,18 +56,17 @@ This application assumes you have: "proxy" : "http://localhost:8080" ``` to whatever the IP of where express is running. Typically you can use something similar to the default but you can change the IP and port as long as it coincides with what is in `server.js`. -4. In `ui-react/`, open a terminal or cmd: +4. In the root directory, open a terminal or cmd: ``` - $ npm install $ npm run build ``` 5. In the root directory, open a terminal or cmd: ``` - $ node server.js + $ npm start ``` -6. If you want to start the react development server, in `ui-react/` run: +6. If you want to start the react development server, in the root directory run: ``` - $ npm start + $ npm start-ui-dev ``` *** diff --git a/package.json b/package.json index c9008b5..b0385ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,12 @@ { "name": "flighttracker", "main": "server.js", + "scripts": { + "postinstall": "cd ui-react && npm install", + "build": "cd ui-react && npm run build", + "start": "node server", + "start-ui-dev": "cd ui-react && npm start" + }, "dependencies": { "ews-javascript-api": "^0.8.0", "express": "^4.16.2",