This <https://gist.github.com/dc343d584fecb3005fdb> runs locally via Aptana 
server but won't run remotely without it. I creating a server node (using 
the code below) but I couldnt find out how to connect other pages other 
than index.html to the server/sockets. Could someone help me translate what 
I did here <https://gist.github.com/dc343d584fecb3005fdb> to use a node 
http server? Thanks!

var app = require('http').createServer(handler), io = 
require('socket.io').listen(app), 
fs = require('fs')

app.listen(80);

function handler(req, res) {

fs.readFile(__dirname + '/index.html', function(err, data) {

 if(err) {

 res.writeHead(500);

 return res.end('Error loading index.html');

 }

 res.writeHead(200);

 res.end(data);

});

}

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to