Created
April 6, 2017 11:33
-
-
Save carld/5d13db570bb2f9674a8b71dbd401b529 to your computer and use it in GitHub Desktop.
Heroku Clojure Ring GrapheneDB app deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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