mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
deploy: 493855e57b14f45c6b93c47c57da12bcccb494a5
This commit is contained in:
parent
d1ebd9927d
commit
97661b2cc2
6 changed files with 6 additions and 10 deletions
|
|
@ -11,8 +11,8 @@
|
|||
<div class="by-name">
|
||||
<h2>OCaml package documentation</h2>
|
||||
<ol>
|
||||
<li><a href="tiny_httpd/index.html">tiny_httpd</a> <span class="version">0.12</span></li>
|
||||
<li><a href="tiny_httpd_camlzip/index.html">tiny_httpd_camlzip</a> <span class="version">0.12</span></li>
|
||||
<li><a href="tiny_httpd/index.html">tiny_httpd</a> <span class="version">0.13</span></li>
|
||||
<li><a href="tiny_httpd_camlzip/index.html">tiny_httpd_camlzip</a> <span class="version">0.13</span></li>
|
||||
</ol>
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
|||
|
|
@ -90,4 +90,4 @@ echo:
|
|||
<span><a href="#type-t">t</a> <span class="arrow">-></span></span>
|
||||
<span><span><span>(<span class="type-var">'a</span>, <span><span>string <a href="../Tiny_httpd_server/Request/index.html#type-t">Request.t</a></span> <span class="arrow">-></span></span> <span><a href="#type-server_sent_generator">server_sent_generator</a> <span class="arrow">-></span></span> unit)</span> <a href="../Tiny_httpd_server/Route/index.html#type-t">Route.t</a></span> <span class="arrow">-></span></span>
|
||||
<span><span class="type-var">'a</span> <span class="arrow">-></span></span>
|
||||
unit</span></code></div><div class="spec-doc"><p>Add a handler on an endpoint, that serves server-sent events.</p><p>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 <code>GET</code>. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See <a href="#type-server_sent_generator"><code>server_sent_generator</code></a> for more details.</p><p>This handler stays on the original thread (it is synchronous).</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.9</li></ul></div></div><h5 id="run-the-server"><a href="#run-the-server" class="anchor"></a>Run the server</h5><div class="odoc-spec"><div class="spec value anchored" id="val-stop"><a href="#val-stop" class="anchor"></a><code><span><span class="keyword">val</span> stop : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Ask the server to stop. This might not have an immediate effect as <a href="#val-run"><code>run</code></a> might currently be waiting on IO.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-run"><a href="#val-run" class="anchor"></a><code><span><span class="keyword">val</span> run : <span>?after_init:<span>(<span>unit <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><span>(unit, exn)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p>Run the main loop of the server, listening on a socket described at the server's creation time, using <code>new_thread</code> to start a thread for each new client.</p><p>This returns <code>Ok ()</code> if the server exits gracefully, or <code>Error e</code> if it exits with an error.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">after_init</span> <p>is called after the server starts listening. since NEXT_RELEASE .</p></li></ul></div></div><h3 id="utils"><a href="#utils" class="anchor"></a>Utils</h3><div class="odoc-spec"><div class="spec module anchored" id="module-Util"><a href="#module-Util" class="anchor"></a><code><span><span class="keyword">module</span> Util</span><span> = <a href="../Tiny_httpd_util/index.html">Tiny_httpd_util</a></span></code></div></div><h3 id="static-directory-serving"><a href="#static-directory-serving" class="anchor"></a>Static directory serving</h3><div class="odoc-spec"><div class="spec module anchored" id="module-Dir"><a href="#module-Dir" class="anchor"></a><code><span><span class="keyword">module</span> Dir</span><span> = <a href="../Tiny_httpd_dir/index.html">Tiny_httpd_dir</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Html"><a href="#module-Html" class="anchor"></a><code><span><span class="keyword">module</span> Html</span><span> = <a href="../Tiny_httpd_html/index.html">Tiny_httpd_html</a></span></code></div><div class="spec-doc"><p>Alias to <a href="../Tiny_httpd_html/index.html"><code>Tiny_httpd_html</code></a></p></div></div></div></body></html>
|
||||
unit</span></code></div><div class="spec-doc"><p>Add a handler on an endpoint, that serves server-sent events.</p><p>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 <code>GET</code>. This will set the header "content-type" to "text/event-stream" automatically and reply with a 200 immediately. See <a href="#type-server_sent_generator"><code>server_sent_generator</code></a> for more details.</p><p>This handler stays on the original thread (it is synchronous).</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.9</li></ul></div></div><h5 id="run-the-server"><a href="#run-the-server" class="anchor"></a>Run the server</h5><div class="odoc-spec"><div class="spec value anchored" id="val-stop"><a href="#val-stop" class="anchor"></a><code><span><span class="keyword">val</span> stop : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div><div class="spec-doc"><p>Ask the server to stop. This might not have an immediate effect as <a href="#val-run"><code>run</code></a> might currently be waiting on IO.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-run"><a href="#val-run" class="anchor"></a><code><span><span class="keyword">val</span> run : <span>?after_init:<span>(<span>unit <span class="arrow">-></span></span> unit)</span> <span class="arrow">-></span></span> <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><span>(unit, exn)</span> <span class="xref-unresolved">Stdlib</span>.result</span></span></code></div><div class="spec-doc"><p>Run the main loop of the server, listening on a socket described at the server's creation time, using <code>new_thread</code> to start a thread for each new client.</p><p>This returns <code>Ok ()</code> if the server exits gracefully, or <code>Error e</code> if it exits with an error.</p><ul class="at-tags"><li class="parameter"><span class="at-tag">parameter</span> <span class="value">after_init</span> <p>is called after the server starts listening. since 0.13 .</p></li></ul></div></div><h3 id="utils"><a href="#utils" class="anchor"></a>Utils</h3><div class="odoc-spec"><div class="spec module anchored" id="module-Util"><a href="#module-Util" class="anchor"></a><code><span><span class="keyword">module</span> Util</span><span> = <a href="../Tiny_httpd_util/index.html">Tiny_httpd_util</a></span></code></div></div><h3 id="static-directory-serving"><a href="#static-directory-serving" class="anchor"></a>Static directory serving</h3><div class="odoc-spec"><div class="spec module anchored" id="module-Dir"><a href="#module-Dir" class="anchor"></a><code><span><span class="keyword">module</span> Dir</span><span> = <a href="../Tiny_httpd_dir/index.html">Tiny_httpd_dir</a></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Html"><a href="#module-Html" class="anchor"></a><code><span><span class="keyword">module</span> Html</span><span> = <a href="../Tiny_httpd_html/index.html">Tiny_httpd_html</a></span></code></div><div class="spec-doc"><p>Alias to <a href="../Tiny_httpd_html/index.html"><code>Tiny_httpd_html</code></a></p></div></div></div></body></html>
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Out (tiny_httpd.Tiny_httpd_html_.Out)</title><link rel="stylesheet" href="../../../_odoc_support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.0"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../_odoc_support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../index.html">tiny_httpd</a> » <a href="../index.html">Tiny_httpd_html_</a> » Out</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd_html_.Out</span></code></h1><p>Output for HTML combinators.</p><p>This output type is used to produce a string reasonably efficiently from a tree of combinators.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.12</li></ul></header><div class="odoc-content"><div class="odoc-spec"><div class="spec type anchored" id="type-t"><a href="#type-t" class="anchor"></a><code><span><span class="keyword">type</span> t</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span>unit <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-clear"><a href="#val-clear" class="anchor"></a><code><span><span class="keyword">val</span> clear : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_char"><a href="#val-add_char" class="anchor"></a><code><span><span class="keyword">val</span> add_char : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span>char <span class="arrow">-></span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_string"><a href="#val-add_string" class="anchor"></a><code><span><span class="keyword">val</span> add_string : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span>string <span class="arrow">-></span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_format_nl"><a href="#val-add_format_nl" class="anchor"></a><code><span><span class="keyword">val</span> add_format_nl : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-with_no_format_nl"><a href="#val-with_no_format_nl" class="anchor"></a><code><span><span class="keyword">val</span> with_no_format_nl : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> <span><span>(<span>unit <span class="arrow">-></span></span> <span class="type-var">'a</span>)</span> <span class="arrow">-></span></span> <span class="type-var">'a</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_string"><a href="#val-to_string" class="anchor"></a><code><span><span class="keyword">val</span> to_string : <span><a href="#type-t">t</a> <span class="arrow">-></span></span> string</span></code></div></div></div></body></html>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<span>?headers:<a href="../Headers/index.html#type-t">Headers.t</a> <span class="arrow">-></span></span>
|
||||
<span>code:<a href="../Response_code/index.html#type-t">Response_code.t</a> <span class="arrow">-></span></span>
|
||||
<span><a href="../index.html#type-byte_stream">byte_stream</a> <span class="arrow">-></span></span>
|
||||
<a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Same as <a href="#val-make_raw"><code>make_raw</code></a> but with a stream body. The body will be sent with the chunked transfer-encoding.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make_void"><a href="#val-make_void" class="anchor"></a><code><span><span class="keyword">val</span> make_void : <span>?headers:<a href="../Headers/index.html#type-t">Headers.t</a> <span class="arrow">-></span></span> <span>code:int <span class="arrow">-></span></span> <span>unit <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Return a response without a body at all.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> NEXT_RELEASE</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make :
|
||||
<a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Same as <a href="#val-make_raw"><code>make_raw</code></a> but with a stream body. The body will be sent with the chunked transfer-encoding.</p></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make_void"><a href="#val-make_void" class="anchor"></a><code><span><span class="keyword">val</span> make_void : <span>?headers:<a href="../Headers/index.html#type-t">Headers.t</a> <span class="arrow">-></span></span> <span>code:int <span class="arrow">-></span></span> <span>unit <span class="arrow">-></span></span> <a href="#type-t">t</a></span></code></div><div class="spec-doc"><p>Return a response without a body at all.</p><ul class="at-tags"><li class="since"><span class="at-tag">since</span> 0.13</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make"><a href="#val-make" class="anchor"></a><code><span><span class="keyword">val</span> make :
|
||||
<span>?headers:<a href="../Headers/index.html#type-t">Headers.t</a> <span class="arrow">-></span></span>
|
||||
<span><span><span>(<a href="#type-body">body</a>, <a href="../Response_code/index.html#type-t">Response_code.t</a> * string)</span> <span class="xref-unresolved">Stdlib</span>.result</span> <span class="arrow">-></span></span>
|
||||
<a href="#type-t">t</a></span></code></div><div class="spec-doc"><p><code>make r</code> turns a result into a response.</p><ul><li><code>make (Ok body)</code> replies with <code>200</code> and the body.</li><li><code>make (Error (code,msg))</code> replies with the given error code and message as body.</li></ul></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-make_string"><a href="#val-make_string" class="anchor"></a><code><span><span class="keyword">val</span> make_string :
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue