I'm looking for an HTTP server that can be invoked from the command line for localhost
. I want it to be able to watch static html and css files for changes and reload the page viewed in a browser when changes are noticed.
I've found a number of nodejs
packages filling this task, but many of them don't work well. Here are the nodejs
packages I tried:
live-server
is doing it good for the defaultdefault.html
andindex.html
pages. If I want to watch an HTML page which is notindex.html
ordefault.html
, I don't see the browser actually updates.fast-live-reload
perhaps is not suited for static web pages and only for web applications of some sort.livereload
just doesn't work at all, perhaps it is not suited for static web pages and only for web applications as well
EDIT
nginx
is an overkill.
webpack-dev-server
seems like is good choice only for people who work with the webpack JS framework. I tried it with webpack-dev-server .
and it gives me the following errors:
ERROR in multi (webpack)-dev-server/client?http://localhost:8080 ./
Module not found: Error: Can't resolve '/home/doron/repos/mathrills.com/' in '/home/doron/repos/mathrills.com'
@ multi (webpack)-dev-server/client?http://localhost:8080 ./
webpack: Failed to compile
While searching the internet, it seemed that most of these packages are not meant for static and plain HTML and CSS web pages. I'm not a web applications developer. I just want to write plain HTML and CSS and that's all.
<meta>
tags). Any sort of smart reload that only reloads when the page actually changes on the server will need custom server support for that and will likely need a persistent webSocket connection from web page to server to the browser can be told by the server when to fetch updated content.