This commit is contained in:
c-cube 2024-02-23 03:22:55 +00:00
parent 6b5dfa9200
commit c1591afaba
6 changed files with 15 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd (tiny_httpd.Tiny_httpd)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../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> &#x00BB; Tiny_httpd</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd</span></code></h1><p>Tiny Http Server</p><p>This library implements a very simple, basic HTTP/1.1 server using blocking IOs and threads. Basic routing based on <code>Scanf</code> is provided for convenience, so that several handlers can be registered.</p><p>It is possible to use a thread pool, see <a href="#val-create"><code>create</code></a>'s argument <code>new_thread</code>.</p><p>The <code>echo</code> example (see <code>src/examples/echo.ml</code>) demonstrates some of the features by declaring a few endpoints, including one for uploading files:</p><pre class="language-ocaml"><code>module S = Tiny_httpd <html xmlns="http://www.w3.org/1999/xhtml"><head><title>Tiny_httpd (tiny_httpd.Tiny_httpd)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../_odoc-theme/odoc.css"/><meta name="generator" content="odoc 2.4.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../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> &#x00BB; Tiny_httpd</nav><header class="odoc-preamble"><h1>Module <code><span>Tiny_httpd</span></code></h1><p>Tiny Http Server</p><p>This library implements a very simple, basic HTTP/1.1 server using blocking IOs and threads. Basic routing based is provided for convenience, so that several handlers can be registered.</p><p>It is possible to use a thread pool, see <a href="#val-create"><code>create</code></a>'s argument <code>new_thread</code>.</p><p>The <code>echo</code> example (see <code>src/examples/echo.ml</code>) demonstrates some of the features by declaring a few endpoints, including one for uploading files:</p><pre class="language-ocaml"><code>module S = Tiny_httpd
let () = let () =
let server = S.create () in let server = S.create () in

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long