Auto-reload webpage by monitoring files/directories, for web development.
It's a simple Go program to
- watch one or more files/directories
- tail (follow) log file
- start a websocket server and serve events
- connect to websocket server and listen to events
- reload page once file/directory changed
- display content from log file
I wanted a simple way to do reload-on-save when I was working on a PHP project.
Build and Run
config.json.example and save as
(note, directories watch are NOT recursive)
$ go get . $ go build monitor.go $ go build ws-server
$ ./ws-server && ./monitor -f config.json
- move into package.
- combine server and monitor as one.