Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dttp

A simple HTTP static dev server with live reloading.

Build

Use make:

$ make

Builds the binary to the ./out directory by default. Set variable DEST to change it:

$ DEST=bin make

Install

Use make:

$ make install

Installs in /usr/local by default. Set variable PREFIX to change it:

$ PREFIX=~/.local make install

Usage

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.

Live Reload

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

About

A simple HTTP dev server with live reloading

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages