https://github.com/lichendust/toil
🗜️ A no-nonsense hot-loading static file server
https://github.com/lichendust/toil
jamstack server static-site web webdev
Last synced: 3 months ago
JSON representation
🗜️ A no-nonsense hot-loading static file server
- Host: GitHub
- URL: https://github.com/lichendust/toil
- Owner: lichendust
- License: mit
- Created: 2023-10-19T16:04:22.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-21T00:06:39.000Z (10 months ago)
- Last Synced: 2026-01-13T18:51:58.857Z (5 months ago)
- Topics: jamstack, server, static-site, web, webdev
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# 🗜️ Toil
A simple, no-nonsense, hot-reloading web server for local static site development.
Toil is something I built in a day to solve this problem for myself. It's never going to be much cleverer than it already is. You may use it at your own risk.
## What does it do?
It supports regular old static file structures —
localhost:3456/page/index.html
...but also pretty URLs —
localhost:3456/page
If those files change on disk, it will hot-reload them. It polls once every second so as not to unduly waste resources.
With appropriate firewall permissions, it can serve as many clients as you like (within reason).
## Installation
With the Go compiler —
go install github.com/lichendust/toil@latest
## Usage
toil
Will immediately begin serving and hot-loading the working directory. It will also, on startup, open your default browser to the `index.html` page it finds there.
toil path/to/files
You can optionally pass a path, to serve a specific folder. Toil just changes directories internally and starts normally.
Use Ctrl+C to close it.
Use the `-r` flag to specific a domain to replace with local paths.
toil -r https://lichendust.com path/to/files
This will strip out the exact string from any pages Toil serves, a simple way to make links relative in locally served pages that otherwise contain fully qualified URLs. Useful for SSGs that don't have their own servers.
## Important Info
Toil expects properly formatted HTML files with at least a `` and ``. It will insert its client-side hot-reload listener into the ``. There must *be a head already for this to work*. Toil is not a smart server and will not solve any incompletely-formatted HTML documents for you.