Running http-server in background from an npm script
You can run a process in background by appending & in the end. And then use the postscript hook that npm offers us, in order to kill the background process. “scripts”: { “web-server”: “http-server -p 7777 httpdocs &”, “pretest”: “gulp build-httpdocs && npm run web-server”, “test”: “mocha spec.js”, “posttest”: “pkill -f http-server” } But what … Read more