open Lwt.Infix module Main (S : Mirage_stack.V4) (KV : Mirage_kv.RO) (CL : Mirage_clock.PCLOCK) = struct module TLS = Tls_mirage.Make (S.TCPV4) module X509 = Tls_mirage.X509 (KV) (CL) module Http = Cohttp_mirage.Server (TLS) module Body = Cohttp_lwt.Body let callback _conn req body = let resp = Cohttp.Response.make ~status:`OK () in (match Cohttp.Request.meth req with | `POST -> Body.to_string body >|= fun contents -> "
" ^ contents ^ "" | _ -> Lwt.return "") >|= fun inlet -> let body = Body.of_string @@ "