View raw

1 (** Serving the static assets embedded at build time. 2 3 Assets are compiled into the executable by [ocaml-crunch] (see the rule in 4 [lib/dune]), so a deployment is a single binary with no asset directory to 5 keep in sync. Responses are cached for a day; because the content ships with 6 the binary, a new release is the only thing that can change them. *) 7 8 val handler : Dream.handler 9 (** Dream handler for requests under [/static/**]. Looks up the path in the 10 embedded asset store and responds with appropriate content type and cache 11 headers, or 404 when the asset is not found. *) 12