commit 994735dda164700c6b1f9496a9603e5b0ab63195 parent cf0640087f279ec4e01d8e2ad6d3b83842bdf6fd Author: Daniel Barlow <dan@telent.net> Date: Wed, 6 Aug 2025 22:44:33 +0100 pass pathname as param to run Diffstat:
| M | Makefile | | | 2 | +- |
| M | main.fnl | | | 4 | ++-- |
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile @@ -12,7 +12,7 @@ $(NAME): $(patsubst %.fnl,%.lua,$(MODULES)) Makefile chmod +x $@ run: - fennel --correlate -e '((. (require :main) :run) )' + fennel --correlate -e '((. (require :main) :run) "data/blogs/telent.blog/posts/") ' test: fennel --correlate run-tests.fnl $(MODULES) diff --git a/main.fnl b/main.fnl @@ -302,9 +302,9 @@ href=\"https://axillae.telent.net/\">@dan@axillae.telent.net</a> (dispatch route stream collection) (server.headers stream { ":status" :404 } true)))) -(fn run [] +(fn run [path] (let [event-loop (cqueues.new) - collection (site.for-pathname "data/blogs/telent.blog/posts/") + collection (site.for-pathname path) myserver (server.new { :onstream (partial http-handler collection) })] (event-loop:wrap #(myserver:loop)) (event-loop:wrap #(collection:watch))