diff --git a/TODO b/TODO index 709d88b..77c9fa8 100644 --- a/TODO +++ b/TODO @@ -1,11 +1,11 @@ Acequia TODO ------------ -Add namespace to the message object - -OSCClient.prototype.send = function (message) { - // TODO: convert the message to an OSC message Define OSC messages for connect/disconnect, etc. -rename the msg module to something else. \ No newline at end of file +rename the msg module to something else. + +Add mdns back to package.json + , "mdns" : ">=0.0.7" + \ No newline at end of file diff --git a/lib/acequia.js b/lib/acequia.js index 1cfb87a..b4ddf37 100644 --- a/lib/acequia.js +++ b/lib/acequia.js @@ -32,13 +32,14 @@ var acequiaClients = null; function AcequiaServer(options) { this.options = Object.extend({ - ipAddress: "0.0.0.0", - oscPort: 9090, - wsPort: 9091, - tcpPort: 9092, - timeout: 600000, - express_app: null, - enableDiscovery: true + ipAddress: "0.0.0.0" + , oscPort: 9090 + , wsPort: 9091 + , tcpPort: 9092 + , timeout: 600000 + , express_app: null + , minify_client: true + , enableDiscovery: true }, options || {}); this.acequiaClients = new ac.AcequiaClients(this.options.timeout * 1000); @@ -252,7 +253,7 @@ AcequiaServer.prototype.createTCPServer = function () { * @return the socket.io server */ AcequiaServer.prototype.createWSServer = function () { - var clientCode, httpServer, io, app; + var clientCode, io, app; if (!clientCode) { // Generate the client code @@ -263,7 +264,11 @@ AcequiaServer.prototype.createWSServer = function () { this.options.express_app = express.createServer(); this.options.express_app.listen(this.options.wsPort); } - app = this.options.express_app; + app = this.options.express_app; + + // Add the acequiaServer instance to the web app, so it has acess to its + // options + app.acequiaServer = this; app.configure(function(){ app.use(express.methodOverride()); @@ -280,9 +285,11 @@ AcequiaServer.prototype.createWSServer = function () { }; if (pathName === "/acequia/acequia.js") { - serveClientCode(clientCode.full); - } else if (pathName === "/acequia/acequia.min.js") { - serveClientCode(clientCode.minified); + if (app.acequiaServer.options.minify_client) { + serveClientCode(clientCode.minified); + } else { + serveClientCode(clientCode.full); + } } else { res.statusCode = 404; res.send("Page Not Found:" + req.url); diff --git a/lib/acequiaClient.js b/lib/acequiaClient.js index d55132a..978aa1e 100644 --- a/lib/acequiaClient.js +++ b/lib/acequiaClient.js @@ -56,7 +56,7 @@ var AcequiaClient = function (clientName, uri) { * @returns {String} the URI */ AcequiaClient.prototype.getURI = function (uri) { - var port = 9091, i; + var port = window.location.port, i; if (typeof(uri) !== "undefined") { i = parseInt(uri, 10); diff --git a/package.json b/package.json index 9dfa9d8..911284e 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,10 @@ , "engines": { "node": ">=0.6" } , "dependencies" : { "log4js" : ">=0.4.1" - , "express": "2.5.8" + , "express": ">=2.5.8" , "socket.io": ">=0.9.6" , "socket.io-client":">=0.9.6" , "uglify-js": ">=1.2.5" - , "mdns" : "0.0.x" , "buffertools" : ">=1.0.9" } , "homepage": "https://github.com/prgsmall/acequia" diff --git a/test/client.html b/test/client.html deleted file mode 100644 index dc79c3b..0000000 --- a/test/client.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - -
-