Josh Kamau writes:

> I am new to clojure. My question is: Whats the common practice when it
> comes to deploying webapps built on compojure? running via lein ring server
> or creating a war file ?  I would also like to know which is the best way
> to put load configuration files  i.e using properties file... or using a
> reader to load .clj file with a hashmap def?

I recommend simply embedding jetty and writing a -main function that
uses run-jetty. Then you can just ship an uberjar out to deploy. You can
also use `lein trampoline with-profile production run -m myapp.main` if
you take care that the dependencies are resolved once on your CI server
rather than each time the app is launched; see the end of `lein help
tutorial` for details about that.

You can generate a skeleton app using `lein new heroku myapp` that
contains the needed -main function even if you're not deploying on Heroku.

Another option is to generate an uberwar if you are familiar with the
ecosystem around .war files already. But if not it's easy to just use
jetty and treat a web application like you would any other Clojure app.

-Phil

Attachment: pgpf7wZjGi6nO.pgp
Description: PGP signature

Reply via email to