dream/example/4-counter/counter.ml
2021-03-24 22:08:21 +03:00

10 lines
224 B
OCaml

let counter = ref 0
let () =
Dream.run
@@ Dream.logger
@@ (fun _ ->
counter := !counter + 1;
Dream.log "The count is now %i" !counter;
Dream.respond (Printf.sprintf "You are visitor number %i!" !counter))