sendFile not a function in express-based Node app?
<p>I have the following code in <code>server.js</code> (where app is an express instance), that is supposed to return a file <code>index.html</code> which is located  in the same directory as <code>server.js</code>.</p>

<pre><code>app.get('/', function (req, res) {
    var indexPath = path.resolve('index.html');
    res.sendFile(indexPath);
});
</code></pre>

<p>I log out <code>indexPath</code> and it is the correct path to my html file.  Yet I get the following error </p>

<blockquote>
  <p>TypeError: res.sendFile is not a function</p>
</blockquote>

<p>and call trace:</p>

<blockquote>
<pre><code>at Object.handle (/Users/alexanderbollbach/Desktop/ABApp/server.js:54:9)
at next_layer (/Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/route.js:103:13)
at Route.dispatch (/Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/route.js:107:5)
at /Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/index.js:195:24
at Function.proto.process_params (/Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/index.js:251:12)
at next (/Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/index.js:189:19)
at Layer.jsonParser [as handle] (/Users/alexanderbollbach/Desktop/ABApp/node_modules/body-parser/index.js:31:38)
at trim_prefix (/Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/index.js:226:17)
at /Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/index.js:198:9
at Function.proto.process_params (/Users/alexanderbollbach/Desktop/ABApp/node_modules/express/lib/router/index.js:251:12)
</code></pre>
</blockquote>