From b620a8081926e4c3b4b3fd38f550f1deee1f700e Mon Sep 17 00:00:00 2001 From: nat Date: Sun, 11 May 2025 20:06:21 -0700 Subject: [PATCH] allow for optional port/address binding configuration --- .gitignore | 1 + srv/main.hy | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c99c04c..e64de0c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ www/data www/site www/src/output +srv/srv_config.hy **/__pycache__ **/log diff --git a/srv/main.hy b/srv/main.hy index 94c2785..cd610f2 100644 --- a/srv/main.hy +++ b/srv/main.hy @@ -7,7 +7,10 @@ (require hyrule.control [defmain]) -(setv [ADDRESS PORT] ["127.0.0.1" 5000]) +(try + (import srv-config [ADDRESS PORT]) + (except [ModuleNotFoundError] + (setv [ADDRESS PORT] ["127.0.0.1" 5000]))) (defmain [] (let [socket (socket AF_INET SOCK_STREAM)]