I am using watch-http-server from npm to start a localhost server that automatically refreshes the page on file changes.
https://www.npmjs.com/package/watch-http-server
More specifically, I am using this for unit tests. The npm script navigates to the spec folder and starts up the server on localhost:
"spec": "cd karma_html && cd spec && dir && watch-http-server -a localhost -p 3000 -c-1"
I would like to do the same thing for my main application, however it seems like there are no options for the websocket included in this npm package, thus only one can run at a time.
Currently, for my main application I use a regular http-server expression.
https://www.npmjs.com/package/http-server
"start": "cd dist && http-server -a localhost -p 8000 -c-1",
And I handle page refreshes using the livereload application for Windows (http://livereload.com/). However, this always crashes on the initialization phase, as there's a large amount of files being copied in a short timespan. This gets quite annoying.
I'm looking for either an npm package that supports websocket options or another package similar to watch-http-server that has a different websocket configuration, so I can run it in parallel.
via Pety Petyy
No comments:
Post a Comment