<commit_before>open Mirage

let fs_key = Key.(value @@ kv_ro ())
let assetsfs = generic_kv_ro ~key:fs_key "../assets"
let slidesfs = generic_kv_ro ~key:fs_key "../slides"

let stackv4 = generic_stackv4 default_console tap0
let httpsvr = http_server @@ conduit_direct ~tls:false stackv4

let libraries = [ "tyxml" ]
let packages = [ "tyxml" ]
let http_job =
  foreign ~libraries ~packages "Server.Main"
    (clock @-> http @-> kv_ro @-> kv_ro @-> job)

let () =
  register ~libraries ~packages "decks" [
    http_job $ default_clock $ httpsvr $ assetsfs $ slidesfs
  ]<commit_msg>src: add library deps and `port` key to config<commit_after>open Mirage

let port =
  let doc = Key.Arg.info
      ~doc:"Listening port."
      ~docv:"PORT" ~env:"PORT" ["port"]
  in
  Key.(create "port" Arg.(opt int 80 doc))

let keys = Key.([ abstract port ])

let fs_key = Key.(value @@ kv_ro ())
let assetsfs = generic_kv_ro ~key:fs_key "../assets"
let slidesfs = generic_kv_ro ~key:fs_key "../slides"

let stackv4 = generic_stackv4 default_console tap0
let httpsvr = http_server @@ conduit_direct ~tls:false stackv4

let libraries = [ "tyxml"; "mirage-http"; "logs"; "mirage-logs"; "magic-mime" ]
let packages = [ "tyxml"; "mirage-http"; "logs"; "mirage-logs"; "magic-mime" ]

let http_job =
  foreign ~libraries ~packages ~keys "Server.Main"
    (clock @-> http @-> kv_ro @-> kv_ro @-> job)

let () =
  register ~libraries ~packages "decks" [
    http_job $ default_clock $ httpsvr $ assetsfs $ slidesfs
  ]
{'fraction_non_alphanumeric': 0.14812332439678283, 'fraction_numerical': 0.006702412868632708, 'mean_word_length': 4.026936026936027, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2169291', 'n_tokens_mistral': 542, 'n_tokens_neox': 528, 'n_words': 147}