title: Cannot read property '_header' of undefined
body: <p>The offending code is the <code>app.use(express.static("web"))</code> line.</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 express = require('express')();
  var app = express();
  var http = require('http').Server(app);
  var io = require('socket.io')(http);
  
  //app.get('/', function(res, req) {
  // res.sendFile(__dirname + '/www/index.html');
  //})
  
  app.use(express.static("web"));</code></pre>
  </div>
  </div>
  </p>
  
  <p>which returns the following error in console:</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-html lang-html prettyprint-override"><code>/Users/matthewwalker/CVLGBT/CVLGBT/www/node_modules/finalhandler/index.js:92
      if (!err &amp;&amp; res._header) {
                      ^
  
  TypeError: Cannot read property '_header' of undefined
      at /Users/matthewwalker/CVLGBT/CVLGBT/www/node_modules/finalhandler/index.js:92:21
      at Function.handle (/Users/matthewwalker/CVLGBT/CVLGBT/www/node_modules/express/lib/application.js:170:5)
      at app (/Users/matthewwalker/CVLGBT/CVLGBT/www/node_modules/express/lib/express.js:38:9)
      at Object.&lt;anonymous&gt; (/Users/matthewwalker/CVLGBT/CVLGBT/www/index.js:2:11)
      at Module._compile (internal/modules/cjs/loader.js:689:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
      at Module.load (internal/modules/cjs/loader.js:599:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
      at Function.Module._load (internal/modules/cjs/loader.js:530:3)
      at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)</code></pre>
  </div>
  </div>
  </p>
  
  <p>Other times when I change up the code slightly I get <code>express is not defined</code>. File structure: index.js and node modules under root, while all html/css/js/imgs are under /web. I'm not sure why this header flag is being thrown. When I use the <code>app.get</code> line, it only sends the html file but no images or js. I need to be able to serve the whole directory of /web.</p>