Skip to content

Commit

Permalink
get resource by name
Browse files Browse the repository at this point in the history
  • Loading branch information
ishai committed May 8, 2012
1 parent 3777640 commit f3b6077
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions api.js
Expand Up @@ -31,6 +31,8 @@ var Api = module.exports = Class.extend({
this.resources = [];
this.resources_schemas = [];

this.resources_by_name = {};

var self = this;
this.app.get('/' + this.path, function(req, res){
res.json(self.resources);
Expand All @@ -44,6 +46,9 @@ var Api = module.exports = Class.extend({
register:function (name, resource) {
//Get Default Settings For Api to Resource
var self = this;

this.resources_by_name[name] = resource;

resource.settings = this.settings;

resource.path = _.chain([])
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name":"jest",
"description":"JavaScriptational State Transfer. JS restful API layer with Mongoose based resources. Inspired by python Tastypie",
"version":"0.0.93",
"version":"0.0.94",
"author":"Ishai Jaffe <ishai@empeeric.com>",
"contributors": [
{ "name": "Alon Valadji", "email": "alon@empeeric.com" }
Expand Down

0 comments on commit f3b6077

Please sign in to comment.