diff --git a/Makefile b/Makefile index 5a80e1cde..7ea5be513 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,9 @@ watch: wait stop: - pkill -f "node $(WEBPACK) -d --watch" - pkill -f "node $(WATCH) make clean && make static ./static" + -pkill -f "$(WEBPACK) -d --watch" + -pkill -f "$(WATCH) make clean && make static ./static" + -pkill -f "$(NODE) ./server/index.js" start: $(NODE) ./server/index.js diff --git a/README.md b/README.md index 577f8faa8..b3cddd7b0 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,19 @@ During development, you can use `npm run watch` to cause any update you make to npm start ``` +or to start and watch at once +```bash +npm run dev +``` + Once running, open `http://localhost:8333` in your browser. If you wish to have the server reload automatically, you can install either [nodemon](https://github.com/remy/nodemon) or [forever](https://github.com/foreverjs/forever). +### To stop +```bash +# Stops all `start` and `watch` processes +npm stop +``` + #### Configuration `npm start` and `npm run watch` can be configured with the following environment variables diff --git a/package.json b/package.json index 13cef6b42..922a257f7 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,13 @@ "version": "1.0.0", "description": "Standalone WWW client for Scratch", "scripts": { + "prestart": "make build", "start": "make start", + "stop": "make stop", "test": "make test", "watch": "make watch", - "stop-watch": "make stop-watch", "build": "make build", - "prestart": "make build" + "dev": "make watch && make start &" }, "repository": { "type": "git",