Clojure

Helion Stackato supports deploying Clojure applications using Leiningen.

To create a new Clojure web application, install Leiningen and Noir (a Clojure web framework):

$ lein plugin install lein-noir 1.1.0

Create a Noir project:

$ lein noir new <app-name>
$ cd <app-name>/

Deploy the application to Helion Stackato:

$ stackato push -n <app-name>

4Clojure Database Services Example

(defn assoc-cloud-env
  "Import Cloud Foundry / Helion Stackato environment settings"
  [config]
  (let [port (Integer/parseInt (System/getenv "PORT"))
        srv  (parse-string (System/getenv "VCAP_SERVICES"))
        cred ((first (srv "mongodb-1.8")) "credentials")]
    (assoc config
      :jetty-port port
      :db-host    (cred "host")
      :db-port    (cred "port")
      :db-user    (cred "username")
      :db-pwd     (cred "password")
      :db-dbname  (cred "db"))))

For more information, see the 4clojure sample application.