How do I create new app pages and navigate to them - currently stuck with the one page

Hi team, am new to atlassian apps so am in the process of figuring things out. At the moment it feels like I’ve got the real basic - I have a single page app up, I can use cURL to access the API but am stuck on a few things.

The first being navigating between handlebars pages - it will almost certainly be something I am missing but for ease, I just want to add a second page to my app called “second”

I have added the route in the index.js file - which from what I understand is the correct place and have created the page in the views folder. I then created the menu link and when I select it Jira returns “Cannot GET /second”

The second page file name is “second.hbs” and is located in the views folder in the “getting started” base.

The app is running on ubuntu linux on my laptop and connects to Jira using “NPM start”

The console log states that I get a 404 error when trying to get /second - I suspect there is something im missing with the navigation here…

Thanks all.

Code below:

<index.js-code>

app.get(’/second’, addon.authenticate(), (req, res) => {
// Rendering a template is easy; the render method takes two params:
// name of template and a json object to pass the context in.
res.render(‘second’, {
title: ‘Second Page’,
content: ‘Just a little bit’
}

</index.js-code>

           <p> Vertical Nav goes here</p>

      <article class="aui-flatpack-example">
          <nav class="aui-navgroup aui-navgroup-vertical">
              <div class="aui-navgroup-inner">
                <div class="aui-nav-heading"><strong>Heading</strong></div>
                  <ul class="aui-nav">
                      <li class="aui-nav-selected"><a href="http://example.com/">Selected Nav Item</a></li>
                      <li><a href="second">Second Page</a></li>
                      <li><a href="http://example.com/">Nav item</a></li>
                  </ul>
                  <div class="aui-nav-heading"><strong>Heading</strong></div>
                  <ul class="aui-nav">
                      <li><a href="http://example.com/">Nav item</a></li>
                      <li><a href="http://example.com/">Nav item</a></li>
                  </ul>
                  <div class="aui-nav-heading"><strong>Heading</strong></div>
                  <ul class="aui-nav">
                      <li><a href="http://example.com/">Nav item</a></li>
                      <li><a href="http://example.com/">Nav item</a></li>
                  </ul>
              </div>
          </nav>
      </article>