-
Notifications
You must be signed in to change notification settings - Fork 16
Extending
mdeiters edited this page Sep 13, 2010
·
12 revisions
neo4jr-social is meant to be a simple service offering basic neo4j persistance and querying capabilities in a language agnostic way. You will likely want to do more advance things like custom traversing of your graph. To support this neo4jr-social auto loads extensions from a predefined location. Using this option allows you to add arbitrary methods to the neo4jr-social service.
- By default neo4jr-social will load any jruby (files ending in .rb) files located at:
~/.neo4jr-social
- You can also specify a different location to load ruby files from by setting the neo4jr_extensions environment variable. i.e.
export neo4jr_extensions=/path/to/your/extensions
- Or for you java people out there, you can set system property neo4jr.extensions
Creating extensions are super easy
- Create a file i.e.
vim ~/.neo4jr-social/test.rb
- Paste the following into test.rb,
module Neo4jr class Service < Sinatra::Base
- ..
end
- Restart the service
- Test the new GET request /my_custom_action/123