package mirage-http

  1. Overview
  2. Docs

Plain HTTP file serving from a read-only key-value store.

start http_port ?request_fn fs http will start a static HTTP server listening on http_port. The files to serve will be looked up from the fs key-value store.

If request_fn is supplied, the URI and default header set (including the MIME content-type header) will be passed to it and the response used as the response header set instead.

Parameters

Signature

val start : http_port:int -> ?request_fn:(Uri.t -> Cohttp.Header.t -> Cohttp.Header.t) -> FS.t -> ([> `TCP of int ] -> S.t -> 'a) -> 'a
OCaml

Innovation. Community. Security.