HT-Serve

HT-Serve is a secure HTTPS file server with live reload support, built for UI/dashboard prototyping. It enables frontend developers to test real-time changes under TLS with zero configuration, WebSocket-triggered reloads, and a CLI interface for orchestration.
๐ง Features
- ๐ Auto HTTPS via self-signed certificates (or use custom certs)
- ๐ WebSocket-based live reload on file changes
- ๐งฉ Automatic HTML injection of live-reload script
- ๐งช Built-in test UI (
ht-serve reset-demo
)
- ๐ Health check endpoint at
/healthz
- ๐ง CLI interface with
serve
, check
, and reset-demo
- ๐งพ Production-grade logging and debug mode (
HT_DEBUG=1
)
๐ฆ Installation
pip install .
๐ Usage
Launch the development server:
ht-serve serve --open-browser
Check if HTTPS/WebSocket ports are available:
ht-serve check
Reset and regenerate a demo UI site:
ht-serve reset-demo
โ๏ธ Environment Variables
DASH_CERT_PATH | Full path to the HTTPS certificate (.pem ) |
DASH_KEY_PATH | Full path to the HTTPS private key (.key ) |
DASH_PORT | Port to serve HTTPS on (default: 443 ; fallback: 8443 ) |
HT_DEBUG | Set to 1 to enable verbose logging and file event tracking |
HT_FORCE_CERT | Set to 1 to regenerate the TLS cert/key on next launch |
๐ Directory Structure
HT-Serve/
โโโ ht_serve/
โ โโโ cli.py # Typer-based CLI commands
โ โโโ server.py # Core HTTPS + WebSocket server logic
โ โโโ templates/
โ โ โโโ inject.js # Injected live-reload script
โ โโโ testsite/ # Sample demo UI assets
โโโ pyproject.toml
โโโ requirements.txt
โโโ setup.py
โโโ README.md
๐ชช License
MIT ยฉ HermiTech Labs