package simple_httpd

  1. Overview
  2. Docs
Simple HTTP server using ocaml 5 domains

Install

dune-project
 Dependency

Authors

Maintainers

Sources

1.0.1.tar.gz
md5=92fe48592979d21002e66416c21bf398
sha512=88f090ce45b81cf244f248670608ff71c0db206da5de859c5e784e4fc59698acb329218bfffc81f4ff9796ae465c23e1faf08aaee804cb22dfe50cea757a854d

doc/simple_httpd/Simple_httpd/Dir/Embedded_fs/index.html

Module Dir.Embedded_fsSource

An embedded file system, as a list of files with (relative) paths. This is useful in combination with the "simple-httpd-mkfs" tool, which embeds the files it's given into a OCaml module.

Sourcetype t

The pseudo-filesystem

Sourceval create : ?mtime:float -> unit -> t

create a new pseudo file system.

Sourceval add_file : t -> path:string -> ?mtime:float -> ?headers:Headers.t -> string -> unit

add_file ~path content add at path with the given content to the virtual file system.

  • raises Invalid_argument

    if the path contains '..' or if it tries to make a directory out of an existing path that is a file.

  • parameter path:

    the name of the file (in the url)

  • parameter mtime:

    that last modification time, used for caching.

  • parameter headers:

    extra headers, like mime type.

Sourceval add_dynamic : t -> path:string -> ?mtime:float -> ?headers:Headers.t -> dynamic -> unit

Add some dynamic content to the virtual file system.

  • parameter path:

    the name of the file (in the url)

  • parameter mtime:

    that last modification time, used for caching.

  • parameter headers:

    extra headers, like mime type.

Sourceval add_path : t -> path:string -> ?mtime:float -> ?headers:Headers.t -> ?deflate:string -> string -> unit

add_path vfs ~path real_path add a path to a file on disk at real_path in the embedded file system

  • parameter deflate:

    a path on the disk to a compressed version of the file with Camlzip.

  • parameter path:

    the name of the file (in the url)

  • parameter mtime:

    that last modification time, used for caching.

  • parameter headers:

    extra headers, like mime type.

Sourceval to_vfs : t -> (module VFS)

Convert a pseudo file system into a vfs to use with Dir.add_vfs.