title: How to convert local server to online server Node.js
body: <p>I've been developing this game for a school project. It is supposed to be online multiplayer, but this far i have online used it locally. I can figure out how to change my server code for it to be able to act as a &quot;real&quot; online server.</p>
  <p>The server code:</p>
  <pre><code>// Dependencies
  var express = require('express');
  var http = require('http');
  var path = require('path');
  var socketIO = require('socket.io');
  
  var app = express();
  var server = http.Server(app);
  
  app.set('port', 5000);
  app.use('/static', express.static(__dirname + '/static'));
  
  // Routing
  app.get('/', function(request, response)
  {
    response.sendFile(path.join(__dirname, 'index.html'));
  });
  
  
  
  // Starts the server.
  server.listen(5000, function()
  {
    console.log('Starting server on port 5000');
  });
  
  
  // Add the WebSocket handlers
  io.on('connection', function(socket)
  {
    console.log('New player arrived');
  }); 
  </code></pre>
  <p>Would appreciate any help greatly.</p>