This example demonstrates how to use neo4j-core to execute cypher queries.
Basically, this is a simple Sinatra application, providing a number of endpoints /graph
, /search
and /movie
.
These execute hard-coded Cypher queries against the Neo4j Server backend, and parse the results to provide JSON responses to the frontend JavaScript code.
In your Neo4j web console UI you should type :play movies
to load the data into your database.
Then to start up the web server:
# with rackup NEO4J_URL=http://neo4j:neo5j@localhost:7474 bundle exec rackup config.ru
If your neo4j server is not running on http://localhost:7474
then you can specify an alternate location with an environment variable named NEO4J_URL
. You can use either http
or bolt
like so:
NEO4J_URL=http://neo4j:password@localhost:7474 NEO4J_URL=bolt://neo4j:password@localhost:7687
If your neo4j server is not running on localhost:7474
then you can specify an
alternate location with an environment variable named NEO4J_URL
.