Benagin

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hello, I am trying to do something very basic with phaser. I have a basic index.html file and I'm just trying to load the phaser.js file. The html correctly displays but in the console I get unexpected token < phaser.js:1. Is this a problem? Is is avoidable? I have other components (menu/game) that I am trying to add but this occurs without them anyway. I have the Phaser 2.6.2 from their website. <!DOCYTPE html> <html> <head> <meta charset="UTF-8"> <title>Survive or Die</title> <script src="js/phaser.js"></script> </head> <body> test </body> </html> Here is my index.html. "test" displays properly but when I inspect and look at the console I get this error. I get the same error when I try to add another script ("js/main.js"). Also here is my server, that might be causing the problems. var http = require('http'); fs = require('fs'); url = require('url'); // Create server // The function as argument, defines what happens with each request and // response from the server http.createServer(function(request, response) { var pathname = url.parse(request.url).pathname; console.log("Request for " + pathname + " received."); // In this case we are sending our index.html file to the page fs.readFile('../index.html', function(err, data) { response.writeHead(200, {'Content-Type': 'text/html', 'Content-Length': data.length}); response.write(data); response.end(); }); }).listen(55100); console.log("Listening to server on 55100...") Thanks for any help.