mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 19:25:32 -05:00
chore: add a debug endpoint to echo
This commit is contained in:
parent
842a5d6895
commit
3f0e427bbf
1 changed files with 2 additions and 0 deletions
|
|
@ -17,6 +17,8 @@ let () =
|
|||
(* echo request *)
|
||||
S.add_path_handler server
|
||||
"/echo" (fun req -> S.Response.make_string (Ok (Format.asprintf "echo:@ %a@." S.Request.pp req)));
|
||||
S.add_path_handler ~meth:`POST server
|
||||
"/debug/%B" (fun b _req -> S._enable_debug b; S.Response.make_string (Ok "ok"));
|
||||
S.add_path_handler ~meth:`PUT server
|
||||
"/upload/%s" (fun path req ->
|
||||
S._debug (fun k->k "start upload %S\n%!" path);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue