title: NodeJS server, res.sendfile returning HTML but not the "jscript includes" (<script src>)
body: <p>Basically I want to make a server and then a simple javascript site with phaser to try some stuff, but the html stuff shows, but not the javascript.</p>
  
  <p>Here are my different files &amp; codes:</p>
  
  <p>index.html:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;center&gt;
   &lt;body&gt;
   test
      &lt;script src="http://code.jquery.com/jquery-latest.min.js"&gt;&lt;/script&gt;
      &lt;script src="phaser.min.js"&gt;&lt;/script&gt;
      &lt;script src="game.js"&gt;&lt;/script&gt;
      &lt;div id='game'&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/center&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>game.js:</p>
  
  <pre><code>var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'game', { preload: preload, create: create, update: update });
  
  function preload() {
      game.load.image('char', 'char.png');
  }
  
  var sprite;
  var cursors;
  
  function create() {
      game.physics.startSystem(Phaser.Physics.P2JS);
      game.physics.p2.defaultRestitution = 0.8;
      sprite = game.add.sprite(200, 200, 'char');
      game.physics.p2.enable(sprite);
      sprite.body.setZeroDamping();
      sprite.body.fixedRotation = true;
      text = game.add.text(20, 20, 'l2arrowkeys', { fill: '#ffffff' });
      cursors = game.input.keyboard.createCursorKeys();
  }
  
  function update() {
  
  sprite.body.setZeroVelocity();
  
      if (cursors.left.isDown)
      {
       sprite.body.moveLeft(200);
      }
      else if (cursors.right.isDown)
      {
       sprite.body.moveRight(200);
      }
  
      if (cursors.up.isDown)
      {
       sprite.body.moveUp(200);
      }
      else if (cursors.down.isDown)
      {
       sprite.body.moveDown(200);
      }
  
  }
  </code></pre>
  
  <p>server.js:</p>
  
  <pre><code>var app = require('express')();
  var http = require('http').Server(app);
  var io = require('socket.io')(http);
  app.get('/', function(req, res){
    res.sendfile('index.html');
  });
  io.on('connection', function(socket){
    console.log('a user connected');
    socket.on('disconnect', function(){
      console.log('a user disconnected');
      });
  });
  http.listen(1337, function(){
    console.log('listening on *:1337');
  });
  </code></pre>
  
  <p>Basically the game.js shows up if I only open the index.html in a browser, but not if I do 'node server.js' and then go to localhost:1337, then it would only show the 'test' (plain text), but not the Javascript. I wasn't sure what I should have put as the title, sorry if it's misleading/makes no sense.</p>