I am creating a website that uses php and javascript for most the site. I only want to use NodeJS for the live chat message feature on the site, kind of likes facebook's. Can I use NodeJS without returning any html files? Is that practical?
EDIT: My current server code is this :
var http = require('http');
console.log("before");
var app = http.createServer(function (request, response) {
}).listen(21);
var io = require('socket.io').listen(app);
io.sockets.on('connection', function(socket) {
console.log("Client Connected");
});
Here is relevant client code
<script type="text/javascript">
var socketio = io.connect("localhost:21");
</script>
So why is it that Client Connected never logs? I have gotten it working a while back when returning html files, but for some reason this isn't working :|.