This commit is contained in:
swrup 2025-10-19 14:36:08 +02:00
parent aa2ff7b2f0
commit 20ebbef722

View file

@ -40,6 +40,11 @@ module Respond_with = struct
let* () = with_string ?compression:None req body in let* () = with_string ?compression:None req body in
let* () = add ~field:"accept" Headers.accept_header_value in let* () = add ~field:"accept" Headers.accept_header_value in
respond `Unsupported_media_type respond `Unsupported_media_type
let not_implemented ?hint req =
let body = error_detail ?hint `Not_implemented in
let* () = with_string ?compression:None req body in
respond `Not_implemented
end end
(* TODO check for mathcing ETAG with a middleware instead? *) (* TODO check for mathcing ETAG with a middleware instead? *)
@ -105,6 +110,15 @@ let hello req _server _env =
let* () = add ~field:"content-type" "text/plain" in let* () = add ~field:"content-type" "text/plain" in
respond `OK respond `OK
let not_implemented_routes =
let f req _server _env =
Respond_with.not_implemented ~hint:"this route is not implemented" req
in
let open Vif.Uri in
let open Vif.Route in
[]
let routes = let routes =
let open Vif.Uri in let open Vif.Uri in
let open Vif.Route in let open Vif.Route in