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

Add option to choose directory to serve #19

Closed diogok closed 5 years ago

diogok commented 5 years ago

This can be useful for example when serving a project`s "resources/public" while using deps.edn, such as:

{:aliases 
    {:serve {:extra-deps {nasus {:mvn/version "0.1.6"}}
                     :main-opts ["-m" "http.server"
                                 "--dir" "resources/public"]}}}
kachayev commented 5 years ago

@diogok Thanks! This is a really nice feature to have. Implementation-vice, in case we're dealing with dynamic user-dir, I would prefer to pass it as an argument to the handler, instead of using global def. Could you please update implementation?

diogok commented 5 years ago

Thanks @kachayev, that is a good idea, will look into updating it.

kachayev commented 5 years ago

@diogok Thanks a lot!