title: How can I call a parent route from a page generated by a nested route in nodejs
body: <p>I am using handlebar JS, nedb database and express framework. My project has nested routes like <code>categories/news/recent</code>. The problem is with the link I created in a view of nested route.<br>
  Sample view: <code>&lt;a href="/categories"&gt;return to categories&lt;/a&gt;</code></p>
  
  <p>But the link directs to <code>/categories/news/recent/categories</code> rather than  <code>/categories</code></p>
  
  <p>How can I fix this?</p>
  
  <p>EDIT: Including sample code</p>
  
  <p>route: simulations.js</p>
  
  <pre class="lang-js prettyprint-override"><code>app.get('/bio/:sim_id', (req, res, next) =&gt; {
    const sim_id = req.params.sim_id
  
    db.simulations.find({ _id: sim_id }, (err, docs) =&gt; {
      res.render('simulations/simulation', { data: docs })
    })
  })
  </code></pre>
  
  <p>view: menu.hbs</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;ul&gt;
    &lt;li&gt;&lt;a href="phy"&gt;Physics&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="che"&gt;Chemistry&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="bio"&gt;Biology&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>