Skip to content

Commit

Permalink
Merge pull request #18 from aseemk/v2
Browse files Browse the repository at this point in the history
Update for node-neo4j v2
  • Loading branch information
aseemk committed Jun 12, 2015
2 parents 6c4a674 + c49a57b commit 47528b3
Show file tree
Hide file tree
Showing 11 changed files with 448 additions and 145 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cd node-neo4j-template
npm install
```

You'll also need a local Neo4j 2.0 instance.
You'll also need a local Neo4j 2.x instance.
Install it via **[neo4j.org/download](http://neo4j.org/download)**,
or if you're on a Mac, `brew install neo4j`.

Expand All @@ -48,12 +48,12 @@ npm test

## Deploying

This app is running on Heroku, using the free test version of the
This app is running on Heroku, using the free version of the
[GrapheneDB add-on](https://addons.heroku.com/graphenedb):

<https://node-neo4j-template.herokuapp.com/>

If you want to run your own instance similarly, it's just one click of a button away:
You can run your own instance similarly for free:

[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

Expand All @@ -73,6 +73,7 @@ If you're deploying in another way, the code also checks for a `NEO4J_URL`
environment variable to support pointing to any other Neo4j database.
The value of this variable should be set to the database root URL, and it can
contain HTTP Basic Auth info. E.g. `https://user:[email protected]:5678`.
You can alternately pass the auth portion (`user:pass`) as `NEO4J_AUTH`.

One thing to note is that `npm start` is currently geared towards development:
it runs [node-dev](https://github.com/fgnass/node-dev) instead of node.
Expand Down
10 changes: 5 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ app.get('/', routes.site.index);

app.get('/users', routes.users.list);
app.post('/users', routes.users.create);
app.get('/users/:id', routes.users.show);
app.post('/users/:id', routes.users.edit);
app.del('/users/:id', routes.users.del);
app.get('/users/:username', routes.users.show);
app.post('/users/:username', routes.users.edit);
app.del('/users/:username', routes.users.del);

app.post('/users/:id/follow', routes.users.follow);
app.post('/users/:id/unfollow', routes.users.unfollow);
app.post('/users/:username/follow', routes.users.follow);
app.post('/users/:username/unfollow', routes.users.unfollow);

http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening at: http://localhost:%d/', app.get('port'));
Expand Down
12 changes: 12 additions & 0 deletions models/errors.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var util = require('util');

function ValidationError(msg) {
Error.call(this);
this.name = 'ValidationError';
this.message = msg;
Error.captureStackTrace(this, this.constructor);
}

util.inherits(ValidationError, Error);

exports.ValidationError = ValidationError;
Loading

0 comments on commit 47528b3

Please sign in to comment.