Created
February 29, 2012 21:17
-
-
Save andypetrella/1944456 to your computer and use it in GitHub Desktop.
Deploy Play and Neo4J on Heroku
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
//PREVIOUSLY ::>> val neoRest = :/("localhost", 7474) | |
//NOW use `as` | |
val neoRest = :/(NEO4J_URL, NEO4J_PORT) as (NEO4J_USERNAME, NEO4J_PASSWORD) | |
val neoRestBase = neoRest / "db" / "data" | |
val neoRestNode = neoRestBase / "node" | |
val neoRestRel = neoRestBase / "relationship" | |
val neoRestCypher = neoRestBase / "cypher" | |
def selfRestUriToId(uri: String) = uri.substring(uri.lastIndexOf('/') + 1).toInt | |
def neoRestNodeIndex(indexName: String) = neoRestBase / "index" / "node" / indexName | |
def neoRestNodeById(id: Int) = neoRestNode / id.toString | |
def neoRestRelById(id: Int) = neoRestRel / id.toString | |
//ADDED function to build url and adding credentials at once | |
def buildUrl(u: String) = url(u) as (NEO4J_USERNAME, NEO4J_PASSWORD) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment