mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 19:25:32 -05:00
add a HEAD endpoint to echo
This commit is contained in:
parent
1318d46efa
commit
a86eac85bf
1 changed files with 5 additions and 0 deletions
|
|
@ -244,6 +244,11 @@ let () =
|
|||
Route.(exact "alice" @/ return)
|
||||
(fun _req -> Response.make_string (Ok alice_text));
|
||||
|
||||
Server.add_route_handler ~meth:`HEAD server
|
||||
Route.(exact "head" @/ return)
|
||||
(fun _req ->
|
||||
Response.make_void ~code:200 ~headers:[ "x-hello", "world" ] ());
|
||||
|
||||
(* VFS *)
|
||||
Tiny_httpd.Dir.add_vfs server
|
||||
~config:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue