title: nodejs app running on node server but not showing any output
body: <p>hi i'm new in nodejs. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var io = require('socket.io').listen(server);
  users = [];
  connections = [];
  
  server.listen(process.env.PORT || 3000);
  console.log('server running....on Pro');
  
  app.get ('/', function(req, res){
   res.sendFile(__dirname+'/index.html');
  });
  
      io.sockets.on('connections',function(socket){
   connections.push(socket);
   console.log('connected: %s sockets is connected', connections.length);
  
   //Disconnet function 
   socket.on('disconnect', function(data){
    
    users.splice(users.indexOf(socket.username),1);
    updateUsernames();
    connections.splice(connections.indexOf(socket),1);
    console.log('Disconneted: %s sockets connected', connections.length);
   });
   //send messege
   socket.on('send massege', function(data){
   io.sockets.emit('new massege', {msg: data, user:socket.username});
   });
  
   //new user
   socket.on('new user', function(data, callback){
    callback(true);
    socket.username = data;
    user.push(socket.username);
    updateUsernames();
  
   });
   function updateUsernames(){
    io.sockets.emit('get users', users);
   }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
   &lt;title&gt;Simple Chat App By Probhas&lt;/title&gt;
   &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"&gt;
   &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
   &lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
   &lt;style&gt;
    body{
     margin-top: 30px;
    }
      #messageArea{
        display: none;
      }
   &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;div class="container"&gt;
        &lt;div id="userFormArea" class="row"&gt;
            &lt;div class="col-md-12"&gt;
                &lt;form id="userForm"&gt;
              &lt;div class="form-group"&gt;
                &lt;label&gt;Enter Username&lt;/label&gt;
                &lt;input class="form-control" id="Username"&gt;&lt;br/&gt;
                &lt;input type="submit" class="btn btn-primary" value="Login"&gt;
              &lt;/div&gt;
            &lt;/form&gt;
            &lt;/div&gt;
        &lt;/div&gt;
      &lt;div id="messageArea" class="row"&gt;
       &lt;div class="col-md-4"&gt;&lt;/div&gt;
        &lt;div class="well"&gt;
         &lt;h3&gt;Online Users&lt;/h3&gt;
         &lt;ul class="list_group" id="users"&gt;&lt;/ul&gt;
        &lt;/div&gt;
       &lt;div class="col-md-8"&gt;&lt;/div&gt;
        &lt;div class="chat" id="chat"&gt;&lt;/div&gt;
        &lt;form id="messageform"&gt;
         &lt;div class="form-group"&gt;
          &lt;label&gt;Enter Your Massege&lt;/label&gt;
          &lt;textarea class="form-control" id="message"&gt;&lt;/textarea&gt;&lt;br/&gt;
          &lt;input type="submit" class="btn btn-primary" value="send Massege"&gt;
         &lt;/div&gt;
        &lt;/form&gt;
      &lt;/div&gt; 
     &lt;/div&gt; 
     &lt;script&gt;
      $(function(){
       var socket = io.connect();
          var $messageform = $('#messageform');
          var $message = $('#messageform');
          var $chat = $('chat');
          var $messageArea = $('#messageArea');
          var $userFormArea = $('#userFormArea');
          var $userForm = $('#userForm');
          var $users = $('#users');
          var $Username = $('#Username');
  
            $messageform.submit(function(e){
              e.preventDefault();
              socket.emit('send massege', $message.val());
              $message.val('');
            });
            socket.on('new massege', function(data){
              $chat.append('&lt;div class="well"&gt;&lt;strong&gt;'+data.user+'&lt;/strong&gt;:'+data.msg+'&lt;/div&gt;');
            });
  
            $userform.submit(function(e){
              e.preventDefault();
              socket.emit('new user', $Username.val(),function(data){
                if (data){
                  $userFormArea.hide();
                  $messageArea.show();
  
                }
              });
              $Username.val('');
            });
            socket.on('get users', function(data){
              var html = '';
              for (i=0; i&lt;data.length; i++){
                html += '&lt;li class = "list-group-item"&gt;'+data[i]+'&lt;/li&gt;';
               }
               $users.html(html);
            });
      });
     &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>i build a real-time chat application using socket.io, Node.js and Express. i followed the <a href="https://www.youtube.com/watch?v=tHbCkikFfDE" rel="nofollow noreferrer">video tutorial</a> i code same as tutorial and the app in running in node server on my localhost. but it don't showing any-output.i think it's can problem with my variable declaration and id in html.but i didn't find the errors till now. here is my server.js file and index.html file </p>