Skip to content

Instantly share code, notes, and snippets.

@andypetrella
Created February 29, 2012 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andypetrella/1944456 to your computer and use it in GitHub Desktop.
Save andypetrella/1944456 to your computer and use it in GitHub Desktop.
Deploy Play and Neo4J on Heroku
//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