On 26 Jul 2010, at 17:30, tguy wrote: > When developing a web app, my preference would be to edit files using > SLIME with lein swank like all of my other development. So, I should > be able to start and stop the server from the repl and can reflect my > changes in the browser simply by reloading a function. > > I used to be able to develop like this easily with compojure 0.3.2, > but since 0.4 it doesn't seem to provide this functionality anymore. > Is there a modern and easy way to fit this style of development with > jetty?
This *is* possible with Compojure 0.4, but you have to wrap your routes or app in a var: (def my-ring-app (-> (routes (GET "/" [] (my-index))) (ring.middleware.file/wrap-file "public") (ring.middleware.file-info/wrap-file-info) (ring.middleware.lint/wrap-lint) (ring.middleware.stacktrace/wrap-stacktrace))) (defn start-app [] (ring.adapter.jetty/run-jetty (var my-ring-app) {:port 8080 :join? false})) Regarding start/stop functionality, see this thread: http://groups.google.com/group/compojure/browse_thread/thread/5606760b86cfd49c -Steve > > On Jul 24, 3:30 am, Mark McGranaghan <mmcgr...@gmail.com> wrote: >> Hi All, >> >> I recently posted to my blog on the process of developing and >> deploying a simple Clojure web application: >> >> http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applica... >> >> The purpose of this post is twofold. The first is to provide some >> documentation in the form of a complete, deployable Clojure web app >> and associated commentary and instructions. To that end I hope you >> find the post useful and that you feel free to ask any questions you >> may have. >> >> The second purpose is to elicit feedback from the community on how >> they would or have approached the problem of developing and deploying >> Clojure web applications. >> >> I'm particularly interested in the specifics of how people tie >> together and round out entire apps with e.g. logging and exception >> handling, how they develop apps locally, and how they deploy them to >> production. I think the most useful basis for discussing things like >> this is complete working examples of applications and associated >> instructions for how to deploy them. I doubt there are very many such >> open-source apps floating around, but if anyone has one to share I >> would love to see it. >> >> Even if you don't have a complete app to share, I would love to hear >> your comments and see your code snippets on the specific aspects of >> the development and deployment process that I covered (or perhaps >> omitted) in the post. >> >> - Mark > > -- > 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 > -- 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