diff --git a/dev/index.html b/dev/index.html index c6140b78..3bd4205b 100644 --- a/dev/index.html +++ b/dev/index.html @@ -13,6 +13,7 @@
These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.
module Buf = Tiny_httpd_bufmodule Byte_stream = Tiny_httpd_streammodule IO = Tiny_httpd_iotype buf = Tiny_httpd_buf.ttype byte_stream = Tiny_httpd_stream.tmodule Meth = Tiny_httpd_server.MethHeaders are metadata associated with a request or response.
module Headers = Tiny_httpd_server.HeadersRequests are sent by a client, e.g. a web browser or cURL. From the point of view of the server, they're inputs.
module Request = Tiny_httpd_server.Requestmodule Response_code = Tiny_httpd_server.Response_codeResponses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t
module Response = Tiny_httpd_server.ResponseBasic type-safe routing of handlers based on URL paths. This is optional, it is possible to only define the root handler with something like Routes.
module Route = Tiny_httpd_server.RouteA middleware can be inserted in a handler to modify or observe its behavior.
module Middleware = Tiny_httpd_server.Middlewaretype t = Tiny_httpd_server.tA HTTP server. See create for more details.
val create :
+ path="/echo"; body="howdy y'all"}These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.
module Buf = Tiny_httpd_bufmodule Byte_stream = Tiny_httpd_streammodule IO = Tiny_httpd_iotype buf = Tiny_httpd_buf.ttype byte_stream = Tiny_httpd_stream.tmodule Meth = Tiny_httpd_server.MethHeaders are metadata associated with a request or response.
module Headers = Tiny_httpd_server.HeadersRequests are sent by a client, e.g. a web browser or cURL. From the point of view of the server, they're inputs.
module Request = Tiny_httpd_server.Requestmodule Response_code = Tiny_httpd_server.Response_codeResponses are what a http server, such as Tiny_httpd, send back to the client to answer a Request.t
module Response = Tiny_httpd_server.ResponseBasic type-safe routing of handlers based on URL paths. This is optional, it is possible to only define the root handler with something like Routes.
module Route = Tiny_httpd_server.RouteA middleware can be inserted in a handler to modify or observe its behavior.
module Middleware = Tiny_httpd_server.Middlewaretype t = Tiny_httpd_server.tA HTTP server. See create for more details.
val create :
?masksigpipe:bool ->
?max_connections:int ->
?timeout:float ->
@@ -95,4 +95,4 @@ echo:
t ->
('a, string Request.t -> server_sent_generator -> unit) Route.t ->
'a ->
- unitAdd a handler on an endpoint, that serves server-sent events.
The callback is given a generator that can be used to send events as it pleases. The connection is always closed by the client, and the accepted method is always GET. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See server_sent_generator for more details.
This handler stays on the original thread (it is synchronous).
val running : t -> boolIs the server running?
val stop : t -> unitAsk the server to stop. This might not have an immediate effect as run might currently be waiting on IO.
val run : ?after_init:(unit -> unit) -> t -> (unit, exn) Stdlib.resultRun the main loop of the server, listening on a socket described at the server's creation time, using new_thread to start a thread for each new client.
This returns Ok () if the server exits gracefully, or Error e if it exits with an error.
module Util = Tiny_httpd_utilmodule Dir = Tiny_httpd_dirmodule Html = Tiny_httpd_htmlAlias to Tiny_httpd_html