Website found at http://coils.cc
A web framework for Clojure. A few notes:
- Uses Clojure for the server side
- Uses ClojureScript for the client side
- Best developed and run using the LightTable IDE
git clone https://github.com/zubairq/coils.git
Then rename the folder coils to the name of your project
Go to a clojurescript view in src/webapp/client/views
From the Lighttable IDE:
(add-to "main" "<div>hello world</div>")
Define an action: (redefine-action "Say something" (js/alert "Hello") )
Call an action: (do-action "Say something")
Define in fns.clj on the server side (using core.async):
(defn say-hello [params]
{:text (str "Hello " (:name params))}
)
From the client side:
(go
(js/alert
(:text (<! (remote "say-hello" {:name "Johnny"})))))
(go
(.log js/console (str (<! (sql "SELECT * FROM test_table where name = ?" ["shopping"] ))))
)
Please note that the SQL is not visible from web browsers as it is encryted via a server side macro.