Permalink
Browse files

integration with resource

  • Loading branch information...
1 parent b242334 commit 48e5e35f0f03fe894fd09b29c153156558e9f3f7 @tehsenaus committed Mar 3, 2012
View
@@ -1,6 +1,5 @@
+var exports = module.exports = require("../core");
-module.exports = {
- models: require("./models"),
- Router: require("./router")
-}
+exports.resource = require("resource/client");
+exports.Router = require("./router");
View
No changes.
View
@@ -1,5 +1,6 @@
module.exports = {
+ resource: require('./resource.js'),
Router: require('./router.js')
}
module.exports.apps = {}
View
@@ -1,16 +1,2 @@
-var core = require("konode/core");
-
-function Resource(name, options) {
- this.name = name;
-};
-
-module.exports = function(name, options) {
- var resource = new Resource(name, options);
- if(name in core.resources) {
- throw new Error("Resource name collision: " + name);
- }
- core.resources[name] = resource;
- return resource;
-}
-module.exports.Resource = Resource;
+module.exports = require('resource');

Large diffs are not rendered by default.

Oops, something went wrong.
View
16 main.js
@@ -9,7 +9,7 @@ var _ = require("underscore");
var jsdom = require("jsdom");
//var hash = require("mhash").hash;
var less = require('less');
-var resource = require("resource");
+var resource = require("resource/server");
var server = require("./server");
var defaults = {
@@ -29,10 +29,10 @@ var defaults = {
root[this.api_root + '.*'] = function(req, res) {
res.notFound('resource not found');
}
-
+
var host = this.api_host || this.host;
- server = connect(dispatch(root));
- return host ? connect.vhost(host, server) : connect(server);
+ server = dispatch(root);
+ return host ? connect.vhost(host, server) : server;
},
port: process.env.PORT || 8080
@@ -51,7 +51,7 @@ module.exports = function(options) {
var konode_js = browserify({
mount: "/site.js",
- require: ["synergy/client", "./viewmodel"]
+ require: ["./viewmodel"]
});
// Add libraries to bundle
@@ -99,7 +99,6 @@ module.exports = function(options) {
// Template server (main index)
options.wrap_host(connect(
function(req, response) {
- console.log("R", req);
if(req.url == "/" || req.url == "")
response.end(template);
else {
@@ -110,11 +109,8 @@ module.exports = function(options) {
}
}
))
-
- );
- if(options.port)
- server = server.listen(options.port);
+ );
//var wnd = jsdom.jsdom(template).createWindow();
//console.log(wnd);
View
@@ -1,6 +1,6 @@
{
"name": "synergy",
- "version": "0.1.3",
+ "version": "0.2.1",
"description": "A web framework based on Knockout.js and Node.js",
@@ -23,12 +23,12 @@
"dependencies": {
"underscore": ">=1.1.6",
- "connect": ">=1.5.2",
- "dispatch": ">=0.0.1",
+ "connect": "https://github.com/tehsenaus/connect/tarball/master",
+ "dispatch": ">=0.2.0",
"quip": ">=0.0.2",
"jsdom": ">=0.2.0",
- "browserify": ">=1.3.0",
- "less": ">=1.1.3",
+ "browserify": ">=1.10.0",
+ "less": ">=1.2.2",
"resource": ">=0.1.0",
"coop": ">=0.0.1"
}
View
@@ -0,0 +1,9 @@
+
+var mongo = require("mongoskin");
+var Class = require("konode/core/class");
+
+var MongoDBDataStore = new Class([Class.Options], {
+ read: function() {
+
+ }
+});
View
@@ -0,0 +1,4 @@
+
+module.exports = {
+ resource: require("./resource")
+}
No changes.

0 comments on commit 48e5e35

Please sign in to comment.