I receive this error in console GET http://localhost/socket.io/socket.io.js 404 (Not Found). I used npm install to install express and socket.io. 
Everytime I try to access localhost:3000 it downloads a file instead of displaying chat.php
This is my javascript code
var express = require('express')
var app = express()
  , http = require('http')
  , server = http.createServer(app)
  , io = require('socket.io').listen(server);
server.listen(3000);
users = [];
connnection = [];
console.log('Server running!');
app.get('/',function(req, res){
    res.sendFile(__dirname + '/game.php');
});
io.sockets.on('connection', function(socket){
  connections.push(socket);
  console.log('Connected: %s sockets connected', connections.length);
  //Disconnect
  socket.on('disconnect', function(data){
  connections.splice(connections.indexOf(socket),1);
  console.log('Disconnected: %s sockets connected', connections.length);
});
});And this is what I added into php file
<script src="/socket.io/socket.io.js"></script>
<script>
$(function(){
    var socket=io.connect();
});
</script> 
     
    