allow for optional port/address binding configuration

This commit is contained in:
2025-05-11 20:06:21 -07:00
parent 0b0b1e6f69
commit b620a80819
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
www/data
www/site
www/src/output
srv/srv_config.hy
**/__pycache__
**/log

View File

@ -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)]