title: res.sendFile absolute path
body: <p>If I do a </p>
  
  <pre><code>res.sendfile('public/index1.html'); 
  </code></pre>
  
  <p>then I get a server console warning </p>
  
  <blockquote>
    <p>express deprecated <code>res.sendfile</code>: Use <code>res.sendFile</code> instead</p>
  </blockquote>
  
  <p>but it works fine on the client side.</p>
  
  <p>But when I change it to </p>
  
  <pre><code>res.sendFile('public/index1.html');
  </code></pre>
  
  <p>I get an error </p>
  
  <blockquote>
    <p>TypeError: path must be absolute or specify root to <code>res.sendFile</code></p>
  </blockquote>
  
  <p>and <code>index1.html</code> is not rendered.</p>
  
  <p>I am unable to figure out what the absolute path is. I have <code>public</code> directory at the same level as <code>server.js</code>. I am doing the <code>res.sendFile</code> from with <code>server.js</code>. I have also declared <code>app.use(express.static(path.join(__dirname, 'public')));</code></p>
  
  <p>Adding my directory structure:</p>
  
  <pre><code>/Users/sj/test/
  ....app/
  ........models/
  ....public/
  ........index1.html
  </code></pre>
  
  <p>What is the absolute path to be specified here ? </p>
  
  <p>I'm using Express 4.x.</p>