I would like to run a chestnut app from the command line, without first starting a repl.
I can’t see a way to do something like:
lein ring server
or
lein run
or
lein with-profile uberjar && java -jar myapp.jar
I can add lein-ring as a plugin and run it that way, but figured there might already be some other way that I was not aware of?
You can always mimic what Heroku does by using Foreman, this is documented in the README that comes with your generated project.
lein with-profile -dev,+production uberjar && foreman start
Or you can have a look at Procfile, which is the file Foreman looks at to know what to run, there you see it does
java $JVM_OPTS -cp target/{{name}}.jar clojure.main -m {{project-ns}}.server
Since the latest release there is also a default namespace configured so you can do java -jar myapp.jar
without the -m
option.