can you help me I downloaded the js file for socket.io browser client.and put it on a js folder...but I am having problem node.js doesn't serves me the external js
<script src="./js/socketio.js"></script>
how do I serve the external js file ?
Here is the app.js server code
var app = require('http').createServer(handler)
var io = require('socket.io')(app);
var fs = require('fs');
app.listen(8080);
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);
});
}
io.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
});
Thank you in advance.