/socket.io/socket.io.js 404 (Not Found)

2019-04-09 16:29发布

问题:

I'm having some issues with socket.io

I have looked at all of the answers that I have seen, and I cannot find any discrepancies. Any help would be appreciated. I was also having formatting issues with pasting the code onto here so I put it onto pastebin.

http://pastebin.com/tmdXALFX

回答1:

https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x

Line 40 becomes

var server = http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});

var io = require('socket.io').listen(server);