Heroku App: http://neo4j-training-backend.herokuapp.com
We use a session id generated by the front-end to control user sessions, it will usually be an UUID.
// execute query, reads or updates
curl -H X-Session:123 -XPOST http://neo4j-training-backend.herokuapp.com/backend/cypher/:id -d'MATCH (n) RETURN n'
// initialize
curl -H X-Session:123 -XPOST http://neo4j-training-backend.herokuapp.com/backend/cypher/:id
// delete, cleanup memory session
curl -H X-Session:123 -XDELETE http://neo4j-training-backend.herokuapp.com/backend
With persistent session handling:
// store database setup with provided id
curl -H X-Session:123 -XPOST http://neo4j-training-backend.herokuapp.com/backend/graph/:id \
-d'cypher statement(s)'
//e.g.
curl -H X-Session:123 -XPOST http://neo4j-training-backend.herokuapp.com/backend/graph/users-graph \
-d'create (:User {name:"Andreas"}),(:User {name:"Michael"})'
// delete persisted session state also removes the in-memory session with the same id if any
curl -H X-Session:123 -XDELETE http://neo4j-training-backend.herokuapp.com/backend/graph/:id
// e.g
curl -H X-Session:123 -XDELETE http://neo4j-training-backend.herokuapp.com/backend/graph/users-graph
curl -H X-Session:123 -XDELETE http://neo4j-training-backend.herokuapp.com/backend/graph/123
// initialize with session-id, fallback to the provided init-id
// returns also previously stored history
curl -H X-Session:123 -XPOST http://neo4j-training-backend.herokuapp.com/backend/cypher/users-graph
// on shutdown/timeout changed database state and input history is saved to storage
// so on next init the modified state will be used as initial state and stored history will be returned
mvn exec:java