update docs

This commit is contained in:
Simon Cruanes 2023-05-24 15:17:04 -04:00
parent 82ebf85ee7
commit 04fb648576
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
4 changed files with 18 additions and 14 deletions

View file

@ -1,11 +1,3 @@
(** Tiny Httpd.
A small HTTP/1.1 server, in pure OCaml, along with some utilities
to build small websites. The primary use case is to build UIs for tools
that are {b not} primarily websites, but can benefit from an embedded
web server.
*)
module Buf = Tiny_httpd_buf
module Byte_stream = Tiny_httpd_stream
include Tiny_httpd_server

View file

@ -1,4 +1,4 @@
(** {1 Tiny Http Server}
(** Tiny Http Server
This library implements a very simple, basic HTTP/1.1 server using blocking
IOs and threads. Basic routing based on {!Scanf} is provided for convenience,
@ -81,10 +81,7 @@ echo:
module Buf = Tiny_httpd_buf
(** {2 Generic stream of data}
Streams are used to represent a series of bytes that can arrive progressively.
For example, an uploaded file will be sent as a series of chunks. *)
(** {2 Generic byte streams} *)
module Byte_stream = Tiny_httpd_stream
@ -105,4 +102,4 @@ module Dir = Tiny_httpd_dir
module Html = Tiny_httpd_html
(** Alias to {!Tiny_httpd_html}
@since NEXT_RELEASE *)
@since 0.12 *)

View file

@ -1,5 +1,8 @@
(** Byte streams.
Streams are used to represent a series of bytes that can arrive progressively.
For example, an uploaded file will be sent as a series of chunks.
These used to live in {!Tiny_httpd} but are now in their own module.
@since 0.12 *)

View file

@ -1,6 +1,18 @@
(** Middleware for compression.
This uses camlzip to provide deflate compression/decompression.
If installed, the middleware will compress responses' bodies
when they are streams or fixed-size above a given limit
(but it will not compress small, fixed-size bodies).
*)
val middleware :
?compress_above:int -> ?buf_size:int -> unit -> Tiny_httpd_server.Middleware.t
(** Middleware responsible for deflate compression/decompression.
@param compress_above threshold, in bytes, above which a response body
that has a known content-length is compressed. Stream bodies
are always compressed.
@param buf_size size of the underlying buffer for compression/decompression
@since 0.11 *)
val setup : ?compress_above:int -> ?buf_size:int -> Tiny_httpd_server.t -> unit