vif/examples/01-hello/main.ml

19 lines
328 B
OCaml
Raw Normal View History

2025-02-01 15:54:10 +00:00
#require "vif" ;;
2025-02-13 16:17:00 +00:00
open Vif ;;
2025-02-18 18:25:30 +00:00
let default req _server () =
2025-02-13 16:17:00 +00:00
let* () = Response.with_string req "Hello World!\n" in
Response.respond `OK
2025-02-01 15:54:10 +00:00
;;
2025-02-18 18:25:30 +00:00
let routes =
let open Vif.U in
let open Vif.R in
let open Vif.Content_type in
[ get (rel /?? nil) --> default ]
;;
2025-02-08 15:37:56 +00:00
let () = Miou_unix.run @@ fun () ->
2025-02-18 18:25:30 +00:00
Vif.run routes () ;;