Skip to content

Commit

Permalink
Add example resources
Browse files Browse the repository at this point in the history
  • Loading branch information
angelini committed Jan 12, 2012
1 parent c03df8b commit 99f635d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
15 changes: 15 additions & 0 deletions example/resources/songs/songs.js
@@ -0,0 +1,15 @@
var Songs = {
Resource: {
get: function(sid, callback) {
callback(null, {sid: sid});
}
},

Collection: {
get: function(callback) {
callback(null, {all: 'songs'});
}
}
};

module.exports = Songs;
19 changes: 19 additions & 0 deletions example/resources/users/contacts/contacts.js
@@ -0,0 +1,19 @@
var Contacts = {
Resource: {
get: function(uid, cid, callback) {
callback(null, {uid: uid, cid: cid});
},

post: function(uid, cid, callback) {
callback(null, {body: this.body});
}
},

Collection: {
get: function(uid, callback) {
callback(null, {uid: uid, all: 'contacts'});
}
}
};

module.exports = Contacts;
2 changes: 1 addition & 1 deletion example/resources/users/users.js
Expand Up @@ -10,6 +10,6 @@ var Users = {
callback(null, {all: 'users'});
}
}
}
};

module.exports = Users;

0 comments on commit 99f635d

Please sign in to comment.