This commit is contained in:
Simon Cruanes 2026-02-15 21:17:07 -05:00
parent a07936dac4
commit 1b53064ed6
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -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
]} *)