How to use _dirname with a sibling directory
<p>My directory is set up like this: </p>

<pre><code>public 
    pages
       index.html
routers
    route.js
</code></pre>

<p>Inside route.js, I do the following: </p>

<pre><code>router.get('/', function(req, res) {
    res.sendFile("/public/pages/index.html", {"root": __dirname});
});
</code></pre>

<p>I get <strong>Error: ENOENT: no such file or directory, stat</strong> because the server is looking on <code>myproject/routers/public/pages/index.html</code> and not <code>myproject/public/pages/index.html</code></p>

<p>1) How do I fix this issue and get it to look in the right path using <code>_dirname</code>? </p>

<p>2) How do I get my server to remember looking in <code>/public/pages/</code> so that I don' have to specify the absolute path every time?</p>