I ran into this error when following a tutorial about creating a chat service. Here is the code: (most of it is automatically generated)
var port = normalizePort(process.env.PORT || '3000');
app.set('port', port);
/**
* Create HTTP server.
*/
var server = http.createServer(app);
/**
* Listen on provided port, on all network interfaces.
*/
var io = require('socket.io').listen(app.listen(port));
io.sockets.on('connection', function (socket) {
socket.emit('message', { message: 'welcome to the chat' });
socket.on('send', function (data) {
io.sockets.emit('message', data);
});
});
Client side:
script(src='/javascripts/chat.js')
script(src='/http://ift.tt/1aeIZU4')
Do I actually have to manually put socket.io.js into the folder? I don't get it...
Aucun commentaire:
Enregistrer un commentaire