A simple HTTP static dev server with live reloading.
Use make:
$ make
Builds the binary to the ./out directory by default.
Set variable DEST to change it:
$ DEST=bin make
Use make:
$ make install
Installs in /usr/local by default.
Set variable PREFIX to change it:
$ PREFIX=~/.local make install
dttp [-a ADDR] [-d DIR]
dttp [-a ADDR] -R
In the 1st form, start a static server listening at the address ADDR, serving files in DIR.
In the 2nd form, send a refresh event to all clients in an already listening server at address ADDR.
A live-reload script is served at /_/refresh.js.
It does NOT watch for file changes.
First, include the script at the end of your HTML files:
<!-- insert at the end of body -->
<script src="/_/refresh.js"></script>
Then, in your build or watch process, execute dttp -R:
$ make && dttp -R