Hi all,

I've just released Frodo 0.2.9 - a web server plugin that allows you to 
develop using Stuart Sierra's 'Reloaded' workflow. It sets up a web server 
that you can nREPL into, easily open a CLJS browser REPL (using Chas 
Emerick's 'Austin' library) and, when you've made changes, to start a fresh 
web-server and refresh the server-side state without restarting the JVM.

*https://github.com/james-henderson/frodo*<https://github.com/james-henderson/frodo>

If you haven't seen it already, Stuart's written a great blog on how to 
develop using the 'Reloaded' workflow and its benefits - it's at 
http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded.

There are plenty of Frodo examples and a sample project on the GitHub repo, 
but the basic premise is that you configure Frodo with a function that 
initialises your system state and returns a handler. When your server-side 
code changes and you run (user/reload-frodo!)in the REPL, it will reload 
any changed namespaces (and anything that depends on a changed namespace), 
restart the web server and ask your function to initialise its state and 
return another handler. This usually looks something like:

(ns your-app.handler
  (:require [compojure.core :refer [routes GET]]
            [compojure.handler :refer [api]]
            [ring.util.response :refer [response]]))
 
(defn app-routes []
  (let [system (init-system)]
    (routes
      (GET "/route/:id" [id]
        (response (handle-get system id)))
 
      ...)))
 
(defn app []
  (-> (app-routes)
      wrap-with-ring-middleware
      api))


You'd then configure Frodo to use '*your-app.handler/app*' as its entry 
point.

Probably the easiest way to get up and running is to use '*splat*', a Lein 
template:

lein new splat <your-project>
cd <your-project>
lein dev

If you've got any questions or feedback, it'd be great to hear it! Let me 
know, either through here, GitHub or Twitter (I'm 
@jarohen<https://twitter.com/jarohen>
)

Hope you all have a great Christmas, and a happy New Year!

James

-- 
-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to