Skip to content
Browse files

get resource by name

  • Loading branch information...
1 parent 3777640 commit f3b6077b1ea5c1a60f129613101e9c697b64db58 @ishai ishai committed
Showing with 6 additions and 1 deletion.
  1. +5 −0 api.js
  2. +1 −1 package.json
View
5 api.js
@@ -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);
@@ -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([])
View
2 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" }

0 comments on commit f3b6077

Please sign in to comment.
Something went wrong with that request. Please try again.