Skip to content

Commit 47528b3

Browse files
committed
Merge pull request #18 from aseemk/v2
Update for node-neo4j v2
2 parents 6c4a674 + c49a57b commit 47528b3

File tree

11 files changed

+448
-145
lines changed

11 files changed

+448
-145
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ cd node-neo4j-template
2323
npm install
2424
```
2525

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

@@ -48,12 +48,12 @@ npm test
4848

4949
## Deploying
5050

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

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

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

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

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

7778
One thing to note is that `npm start` is currently geared towards development:
7879
it runs [node-dev](https://github.com/fgnass/node-dev) instead of node.

app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ app.get('/', routes.site.index);
3636

3737
app.get('/users', routes.users.list);
3838
app.post('/users', routes.users.create);
39-
app.get('/users/:id', routes.users.show);
40-
app.post('/users/:id', routes.users.edit);
41-
app.del('/users/:id', routes.users.del);
39+
app.get('/users/:username', routes.users.show);
40+
app.post('/users/:username', routes.users.edit);
41+
app.del('/users/:username', routes.users.del);
4242

43-
app.post('/users/:id/follow', routes.users.follow);
44-
app.post('/users/:id/unfollow', routes.users.unfollow);
43+
app.post('/users/:username/follow', routes.users.follow);
44+
app.post('/users/:username/unfollow', routes.users.unfollow);
4545

4646
http.createServer(app).listen(app.get('port'), function(){
4747
console.log('Express server listening at: http://localhost:%d/', app.get('port'));

models/errors.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var util = require('util');
2+
3+
function ValidationError(msg) {
4+
Error.call(this);
5+
this.name = 'ValidationError';
6+
this.message = msg;
7+
Error.captureStackTrace(this, this.constructor);
8+
}
9+
10+
util.inherits(ValidationError, Error);
11+
12+
exports.ValidationError = ValidationError;

0 commit comments

Comments
 (0)