When I'm updating (and testing) a specific page in my application, I need to stop the server, start again with node server.js
, switch to the browser window, hit F5 and switch back to the terminal to see the output. This takes a lot of time.. :)
Is there a way I can start Node with something like this:
node server.js -url /my_page
so I can directly see the output as if someone hit the page from their browser?
I found this question but I guess it's included in the server code so it needs to be updated each time too. It is a solution, but I wonder if there is a faster way to do this.
Thanks,
Edit:
With curl, I'm getting this error:
$ node server.js & curl 'http://localhost:5000/my_page'
[2] 12824
curl: (7) Failed to connect to localhost port 5000: Connection refused
[1] Terminated node server.js
$ Listening on port 5000
Notice the last line, is it executing curl
before the server is started?