Refactor webserver port to a variable
This commit is contained in:
parent
82a493bd82
commit
712325aa7b
@ -133,11 +133,12 @@ let serve config_filename =
|
||||
>>= html_response
|
||||
in
|
||||
|
||||
let port = match Uri.port web_config.Configuration.url with Some p -> p | None -> 3666 in
|
||||
print_endline @@ "Server address: " ^ Uri.to_string web_config.Configuration.url;
|
||||
print_endline @@ "Press Ctrl+C to stop.";
|
||||
let app =
|
||||
App.empty
|
||||
|> App.port (match Uri.port web_config.Configuration.url with Some p -> p | None -> 3666)
|
||||
|> App.port port
|
||||
|> middleware @@
|
||||
Middleware.static
|
||||
~local_path:(Fpath.to_string web_config.Configuration.static)
|
||||
|
Loading…
x
Reference in New Issue
Block a user