kachayev / nasus

Zero-configuration command-line async HTTP files server in Clojure. Like Python's SimpleHTTPServer but scalable.
MIT License
166 stars 9 forks source link

Rendering module #15

Open jaromil opened 5 years ago

jaromil commented 5 years ago

how about some way to import this from clojars and run it plugging a rendering module to beautify the listing with hiccup or templating? cheers

kachayev commented 5 years ago

Server runner should be extracted to a separate function to allow testing. After that is done, it would be possible to run the server programmatically. I'm not sure how to expose access to middlewares applied... Let me think about this.

jaromil commented 5 years ago

Another perhaps simplier way around is to have an optional templating system inside nasus that is customisable from external html files. This is trivial and I can also volunteer doing it.

kachayev commented 5 years ago

@jaromil Please, move ahead and submit a PR. I will review it. I have no strong opinion on the matter as I never faced the use case you've described.

jaromil commented 5 years ago

OK, will take me some time. My use-case is basically substituting an old and rusty php setup to serve files using your application, with an nginx reverse-proxy for let's encrypt tls certs. The server is actually under some load and I suspect it will benefit. I like your code and clojure in general very much, because is maintainable.