Live-reloading server for static sites (eventually also dynamic)
  • OCaml 99.7%
  • Dune 0.3%
Find a file
2023-05-12 16:05:35 +03:00
vendor/lwt_luv Simplify directories 2021-03-22 14:01:39 +03:00
.gitignore .gitignore _opam 2023-05-12 16:02:37 +03:00
dream-serve.opam Optionally convert Markdown files to HTML 2023-05-12 16:03:18 +03:00
dream_serve.ml Suppress Dream deprecation warnings 2023-05-12 16:05:35 +03:00
dune Optionally convert Markdown files to HTML 2023-05-12 16:03:18 +03:00
dune-project Initial commit 2021-03-22 00:50:12 +03:00
LICENSE.md Add MIT license 2021-04-23 19:26:37 +03:00
README.md README.md: add info about setting the port number 2023-05-11 12:53:03 +03:00
reload.gif Add graphic 2021-04-23 18:24:47 +03:00

dream-serve

dream-serve is a very simple server for static sites. It reloads your browser when the site changes.



It's good for developing docs, streamlining coverage reports, and so forth. It works by injecting a script into HTML, which opens a WebSocket back to the server. The server uses the WebSocket to tell the browser when to reload.


Usage

opam install dream-serve
dream-serve ./my/site

To choose a port number,

dream-serve ./my/site -p 9090

Based on

dream-serve is implemented as one small OCaml file. It is based on Web framework Dream, libuv binding Luv, and HTML rewriter Lambda Soup.

Special thanks to Ulrik Strid for writing the integration between Lwt and Luv/libuv that makes it possible to easily run Dream over libuv.