Skip to content

Instantly share code, notes, and snippets.

@carld
Created April 6, 2017 11:33
Show Gist options
  • Select an option

  • Save carld/5d13db570bb2f9674a8b71dbd401b529 to your computer and use it in GitHub Desktop.

Select an option

Save carld/5d13db570bb2f9674a8b71dbd401b529 to your computer and use it in GitHub Desktop.
Heroku Clojure Ring GrapheneDB app deployment
The Heroku/Clojure/GrapheneDB Setup
# To enable custom build task. default is `lein uberjar` this changes it to `lein ring uberjar`
heroku config:add LEIN_BUILD_TASK="ring uberjar"
# To run a ring server uberjar, in the Procfile
web: java $JVM_OPTS -jar target/my-app.jar
# Because the GRAPHENEDB_URL does not end with `/db/data`
(def db-url
(let [url (get (System/getenv) "GRAPHENEDB_URL" "http://neo4j:password@localhost:7474/db/data")]
(if (clojure.string/ends-with? url "/db/data")
url
(str url "/db/data"))))
(def conn (nr/connect db-url))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment