Il giorno mercoledì 19 dicembre 2012 22:40:18 UTC+1, Alex Baranosky ha scritto: > > I don't like the environment variable approach because of the dependency > on global state makes deploying harder. > > I'd usually have a config file like config.clj whose contents were just a > Clojure map. When loading the application I'd pass in the location of the > config file as a parameter, and read-string the file at run-time. That > said, it can sometimes be convenient for development to have some default > config file location, so you don't always need to pass the config location > in. > > This is a good idea, but I don't see how this approach is different from the environment variables one. You simply pass the configuration file path directly instead that through an environment variable.
A generic application needs several configurations, and here we have two different approaches: a) Write them in a config.clj file and pass that file location when app is started b) Set some environment variables and let the app get by itself the parameters that it needs from it Both are valid approaches IMHO. Maybe (a) has the advantage that you can write sample config.clj file and pass them around, but other than that I don't see any difference on ease of deployment. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en