How to start a local server and open it in a browser from a shell script
- by davidchambers
I have a test suite which runs in a browser (using QUnit, though that's unimportant). The test suite requires a local server running on a particular port. Running the tests currently involves a few steps:
node test/server
switch to browser of choice
open localhost:3000
I'd like to have a single command which starts the server then runs open localhost:3000. Ideally, the node process would remain in the foreground so it could be killed with ^C. I don't have a good understanding of subshells, so I'm not sure whether this is possible.