add hostname to config

This commit is contained in:
Swrup 2022-02-27 19:44:19 +01:00
parent 1f54bfe9be
commit bff747b4ca
2 changed files with 14 additions and 11 deletions

View file

@ -42,6 +42,14 @@ let open_registration =
let () = Dream.log "open_registration: %b" open_registration
let hostname =
match Scfg.Query.get_dir "hostname" config with
| None -> failwith "no `hostname` in configuration file"
| Some hostname ->
Result.fold ~error:failwith ~ok:Fun.id (Scfg.Query.get_param 0 hostname)
let () = Dream.log "hostname: %s" hostname
let port =
match Scfg.Query.get_dir "port" config with
| None -> 8080