extended client server communication

This commit is contained in:
logsol 2012-07-08 04:29:14 +02:00
parent 94f63fc7b2
commit 81d2aa4ddc
12 changed files with 156 additions and 86 deletions

View file

@ -2,7 +2,7 @@ define(['http', 'node-static'], function(http, nodeStatic) {
function HttpServer(options) {
options.port = options.port || 1234;
options.caching = options.caching || true;
options.caching = typeof options.caching != 'undefined' ? options.caching : true;
options.rootDirectory = options.rootDirectory || './';
this.server = null;
@ -31,6 +31,10 @@ define(['http', 'node-static'], function(http, nodeStatic) {
fileServer.serveFile('./node_modules/requirejs/require.js', 200, {}, req, res);
break;
case req.url == '/lib/SocketIO.js':
fileServer.serveFile('./node_modules/requirejs/require.js', 200, {}, req, res);
break;
case new RegExp(/^\/lib/).test(req.url):
fileServer.serve(req, res, function(){
self.handleFileError(res)