按官方:
, server = require('http').createServer(app)
, io = require('socket.io').listen(server);
server.listen(80);
app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});
io.sockets.on('connection', function (socket) {
socket.emit('news', { hello: 'world' });
socket.on('my other event', function (data) {
console.log(data);
});
}); \n```
结果在客户端(chrome)的Console中报错:
Uncaught SyntaxError: Unexpected token <
不知如何解决,求大神解答