Page
Library
Module
Module type
Parameter
Class
Class type
Source
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.
Until dream-serve is released to opam and npm:
git clone https://github.com/aantron/dream-serve.git
cd dream-serve
_build/install/default/bin/dream-serve /my/site
After npm release:
npx dream-serve ./my/site
After opam release:
opam install dream-serve
dream-serve ./my/site
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.