mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
update docs
This commit is contained in:
parent
82ebf85ee7
commit
04fb648576
4 changed files with 18 additions and 14 deletions
|
|
@ -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 Buf = Tiny_httpd_buf
|
||||||
module Byte_stream = Tiny_httpd_stream
|
module Byte_stream = Tiny_httpd_stream
|
||||||
include Tiny_httpd_server
|
include Tiny_httpd_server
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
(** {1 Tiny Http Server}
|
(** Tiny Http Server
|
||||||
|
|
||||||
This library implements a very simple, basic HTTP/1.1 server using blocking
|
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,
|
IOs and threads. Basic routing based on {!Scanf} is provided for convenience,
|
||||||
|
|
@ -81,10 +81,7 @@ echo:
|
||||||
|
|
||||||
module Buf = Tiny_httpd_buf
|
module Buf = Tiny_httpd_buf
|
||||||
|
|
||||||
(** {2 Generic stream of data}
|
(** {2 Generic 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. *)
|
|
||||||
|
|
||||||
module Byte_stream = Tiny_httpd_stream
|
module Byte_stream = Tiny_httpd_stream
|
||||||
|
|
||||||
|
|
@ -105,4 +102,4 @@ module Dir = Tiny_httpd_dir
|
||||||
|
|
||||||
module Html = Tiny_httpd_html
|
module Html = Tiny_httpd_html
|
||||||
(** Alias to {!Tiny_httpd_html}
|
(** Alias to {!Tiny_httpd_html}
|
||||||
@since NEXT_RELEASE *)
|
@since 0.12 *)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
(** Byte streams.
|
(** 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.
|
These used to live in {!Tiny_httpd} but are now in their own module.
|
||||||
@since 0.12 *)
|
@since 0.12 *)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 :
|
val middleware :
|
||||||
?compress_above:int -> ?buf_size:int -> unit -> Tiny_httpd_server.Middleware.t
|
?compress_above:int -> ?buf_size:int -> unit -> Tiny_httpd_server.Middleware.t
|
||||||
(** Middleware responsible for deflate compression/decompression.
|
(** 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 *)
|
@since 0.11 *)
|
||||||
|
|
||||||
val setup : ?compress_above:int -> ?buf_size:int -> Tiny_httpd_server.t -> unit
|
val setup : ?compress_above:int -> ?buf_size:int -> Tiny_httpd_server.t -> unit
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue