mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2026-03-07 21:37:57 -05:00
doc
This commit is contained in:
parent
a07936dac4
commit
1b53064ed6
1 changed files with 11 additions and 3 deletions
|
|
@ -7,8 +7,6 @@
|
||||||
especially since Eio itself is also subject to change.
|
especially since Eio itself is also subject to change.
|
||||||
@since NEXT_RELEASE *)
|
@since NEXT_RELEASE *)
|
||||||
|
|
||||||
(* TODO: pass in a switch *)
|
|
||||||
|
|
||||||
type 'a with_args =
|
type 'a with_args =
|
||||||
?addr:string ->
|
?addr:string ->
|
||||||
?port:int ->
|
?port:int ->
|
||||||
|
|
@ -28,4 +26,14 @@ val create :
|
||||||
unit ->
|
unit ->
|
||||||
Tiny_httpd.Server.t)
|
Tiny_httpd.Server.t)
|
||||||
with_args
|
with_args
|
||||||
(** Create a server *)
|
(** Create a server.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
{[
|
||||||
|
Eio_main.run @@ fun stdenv ->
|
||||||
|
Eio.Switch.run ~name:"my_server" @@ fun sw ->
|
||||||
|
let server = Tiny_httpd_eio.create ~port:8080 ~stdenv ~sw () in
|
||||||
|
(* add routes... *)
|
||||||
|
Tiny_httpd.Server.add_route_handler [....];
|
||||||
|
Tiny_httpd.Server.run_exn server
|
||||||
|
]} *)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue