package cohttp_static_handler

  1. Overview
  2. Docs
module Http_handler : sig ... end
module Asset : sig ... end
module Single_page_handler : sig ... end
val directory_handler : ?log:Async.Log.t -> ?directory:string -> unit -> Http_handler.t

directory_handler ?log ?directory () returns a handler that serves all files in directory.

A file at directory/path/to/file will be served at host:port/path/to/file.

Directory defaults to the current working directory if none is provided.

If there is a gzipped version of a requested file located at directory/path/to/file.gz, the gzipped file will be served in its place.

Requests are logged to log, which defaults to Log.Global.log.

OCaml

Innovation. Community. Security.