]> Repositorios git - sula.git/commitdiff
Move to config
authorJavier Sagredo <[email protected]>
Thu, 28 May 2026 00:13:38 +0000 (02:13 +0200)
committerJavier Sagredo <[email protected]>
Thu, 28 May 2026 00:13:38 +0000 (02:13 +0200)
config.pl [new file with mode: 0644]
main.pl

diff --git a/config.pl b/config.pl
new file mode 100644 (file)
index 0000000..e5837b4
--- /dev/null
+++ b/config.pl
@@ -0,0 +1,6 @@
+:- module(config, [cert/1, addr/1, port/1, site/1]).
+
+cert("identity.p12").
+addr('127.0.0.1').
+port(1965).
+site("./site").
diff --git a/main.pl b/main.pl
index 9bddfb9e9f10320bd9234e9a94b862e849920b0c..23155794d1574dac3b3b599932b6ca123bcaab3d 100644 (file)
--- a/main.pl
+++ b/main.pl
 :- use_module('./request').
 :- use_module('./response').
 :- use_module('./log').
+:- use_module('./config').
 
 % ------------------------------------------------------------------------------
 
-
-cert("identity.p12").
-addr('127.0.0.1').
-port(1965).
-site("./site").
-
 load_certificate(Context) :-
     cert(Cert),
     log_msg("tls", "Loading certificate from ~s~n", [Cert]),
@@ -63,7 +58,7 @@ with_tls_connection(S0, Context, Kont) :-
 req_serve(S) :-
     read_request(S, RequestChars),
     log_msg("request", "Received raw request: ~s", [RequestChars]),
-    phrase(request(uri(H, P, Path, Query)), RequestChars),
+    phrase(request(uri(_, _, Path, Query)), RequestChars),
     ( serve(S, Path, Query)
     ; log_msg("error", "File not found~n", []),
       phrase(response(not_found, "File not found, sorry"), Response0),