Permalink
Browse files

simplify; serve all client deps via connect.static; newer engine.io

  • Loading branch information...
1 parent f94cb3a commit 61fd2d5b45f55544e6155762b9ab54fab2bcc62b @cadorn cadorn committed Sep 14, 2012
Showing with 140 additions and 56 deletions.
  1. +1 −15 demo/package.json
  2. +6 −2 demo/server.js
  3. +0 −1 demo/www/.gitignore
  4. +1 −1 demo/www/app.js
  5. +36 −18 demo/www/index.html
  6. +35 −0 demo/www/require.js
  7. +4 −2 package.json
  8. +2 −1 server-plugin/package.json
  9. +51 −13 server-plugin/plugin.js
  10. +3 −2 server-plugin/www/client.js
  11. +1 −1 test/all.js
View
@@ -12,20 +12,6 @@
},
"dependencies": {
"architect": "~0.1.4",
- "connect-architect": "~0.0.3",
- "engine.io-client": "https://github.com/c9/engine.io-client/tarball/cdf25f5461821b7a80843d87414e2ee1add02873",
- "jamjs": "~0.2.3"
- },
- "jam": {
- "packageDir": "www/jam",
- "baseUrl": "www",
- "dependencies": {
- "events": "~0.0.1",
- "smith": "~0.1.7",
- "msgpack-js": "~0.1.2"
- }
- },
- "scripts": {
- "install": "jam install"
+ "connect-architect": "~0.0.6"
}
}
View
@@ -13,6 +13,10 @@ exports.main = function main(port, callback) {
port: port
},
{
+ packagePath: "connect-architect/connect.static",
+ prefix: "/static"
+ },
+ {
packagePath: "connect-architect/connect.session",
key: "connect.architect." + port,
secret: "1234"
@@ -25,7 +29,6 @@ exports.main = function main(port, callback) {
},
{
packagePath: "./../server-plugin",
- clientRoute: "/transport/client.js",
messageRoute: /^\/transport\/ser[ver]+/,
messagePath: "/transport/server"
},
@@ -36,14 +39,15 @@ exports.main = function main(port, callback) {
"connect"
],
setup: function(options, imports, register) {
-
+/*
imports.connect.useStart(imports.connect.getModule().router(function(app) {
app.get(/^(\/engine.io.js)$/, function(req, res) {
req.url = req.params[0];
imports.connect.getModule().static(PATH.join(require.resolve("engine.io-client"), "../..", "dist"))(req, res);
});
}));
+*/
imports.connect.useStart(imports.connect.getModule().static(PATH.join(__dirname, "www")));
var TRANSPORT = imports["smith.transport.server"];
View
@@ -1 +0,0 @@
-jam
View
@@ -1,5 +1,5 @@
-require(["transport"], function (TRANSPORT) {
+require(["smith.io"], function (TRANSPORT) {
console.info("Connecting");
View
@@ -1,21 +1,39 @@
<!doctype html>
<html>
-<head>
- <title>Smith Transport Demo</title>
-</head>
-<body>
- <h1>Smith Transport Demo</h1>
- <script src="engine.io.js"></script>
- <script src="jam/require.js"></script>
- <script>
- requirejs.config({
- baseUrl: "/",
- paths: {
- "transport": "/transport/client"
- }
- });
- </script>
- <script src="app.js"></script>
- <p>Check your console for messages.</p>
-</body>
+ <head>
+ <title>Smith Transport Demo</title>
+ </head>
+ <body>
+ <h1>Smith Transport Demo</h1>
+ <script src="/require.js"></script>
+ <script>
+ requirejs.config({
+ baseUrl: "/static",
+ packages: [
+ {
+ "name": "engine.io",
+ "location": "engine.io",
+ "main": "engine.io.js"
+ },
+ {
+ "name": "smith.io",
+ "location": "smith.io",
+ "main": "client.js"
+ },
+ {
+ "name": "smith",
+ "location": "smith",
+ "main": "smith.js"
+ },
+ {
+ "name": "msgpack-js",
+ "location": "msgpack-js",
+ "main": "msgpack.js"
+ }
+ ]
+ });
+ </script>
+ <script src="app.js"></script>
+ <p>Check your console for messages.</p>
+ </body>
</html>
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -14,8 +14,10 @@
},
"pm": "npm",
"dependencies": {
- "smith": "~0.1.7",
- "engine.io": "https://github.com/c9/engine.io/tarball/69c10b97e560c4274007c842352a198bbe07ee1b"
+ "smith": "~0.1.9",
+ "msgpack-js-browser": "~0.1.3",
+ "engine.io": "https://github.com/c9/engine.io/tarball/9042f79ee80d70d52ce82cf53815099312fdf5d0",
+ "engine.io-client": "https://github.com/c9/engine.io-client/tarball/a395f08d83676828f58b27badba72368299c009d"
},
"scripts": {
"test": "node test/all.js"
@@ -8,7 +8,8 @@
"consumes": [
"log",
"http",
- "connect"
+ "connect",
+ "static"
]
}
}
Oops, something went wrong.

0 comments on commit 61fd2d5

Please sign in to comment.