title: Serve static files with Node.js & Socket.IO
body: <p>Although I already browsed some answers both here on SO and the net, I didn't find what I was looking for. I am also a newb in Node.js so perhaps that's the problem.</p>
  
  <p>This is the code that I have and need for starting Node and Socket.IO:</p>
  
  <pre><code>var app = require('express')();
  var http = require('http').Server(app);
  var io = require('socket.io')(http);
  </code></pre>
  
  <p>What I need next would be something like this:</p>
  
  <pre><code>http.use(app.static(__dirname + "/public"));
  </code></pre>
  
  <p>"app has no method 'static' " is my problem. I tried several other combinations to get both what I read on the net regarding including static css and js and serving httpServer instance to Socket.IO.</p>
  
  <p>Thanks :)</p>