I use node.js with express.js framework. I Tried connect to server using io.connect on client side.
Template:
html
head
title Example chat
script(src="http://code.jquery.com/jquery-latest.min.js")
script(src="http://cdn.socket.io/stable/socket.io.js")
script(src="javascripts/chat.js")
body
form
input(type="text" name="msg")
input(type="submit")
It's chat.js:
var socket = io.connect('//localhost:8080');
app.js socket.io require:
var io = require('socket.io').listen(8080);
Firebug gives an error:
TypeError: io.connect is not a function
What is it? How to fix it?
Thanks you.
socket = io.connect('http://localhost:3000/');
– Morrisdaapp->get('/')
on server ? – Pranav