mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 03:05:29 -05:00
test: echo_mio: add a heavier endpoint
This commit is contained in:
parent
e199162e1f
commit
7f9fae1fc8
1 changed files with 12 additions and 0 deletions
|
|
@ -199,6 +199,18 @@ let () =
|
||||||
Route.(exact "alice" @/ return)
|
Route.(exact "alice" @/ return)
|
||||||
(fun _req -> Response.make_string (Ok alice_text));
|
(fun _req -> Response.make_string (Ok alice_text));
|
||||||
|
|
||||||
|
Server.add_route_handler server
|
||||||
|
Route.(exact "alice10" @/ return)
|
||||||
|
(fun _req ->
|
||||||
|
let writer =
|
||||||
|
IO.Writer.make () ~write:(fun oc ->
|
||||||
|
for _i = 1 to 10 do
|
||||||
|
IO.Output.output_string oc alice_text;
|
||||||
|
IO.Output.flush oc
|
||||||
|
done)
|
||||||
|
in
|
||||||
|
Response.make_writer (Ok writer));
|
||||||
|
|
||||||
(* main page *)
|
(* main page *)
|
||||||
Server.add_route_handler server
|
Server.add_route_handler server
|
||||||
Route.(return)
|
Route.(return)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue