I am trying to open a new file when someone clicks on the "Lets edit stuff" button but I get the error Cannot GET /edit.ejs
Both of these files are in the same folder off views/pages/ but I keep getting this error. I have the server.js file running from node.
<body class="container">
<main>
<ul class="nav nav-pills nav-fill">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Homepage</a>
</li>
<li class="nav-item">
<a class="nav-link" href="edit.ejs">Lets edit stuff</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
</ul>
This is what I see on the page
Cannot GET /edit.ejs
I found that the problem was I did not have a app.get for edit so I had to add
app.get('/edit', function(req, res) {
res.render('pages/edit');
});
in my server.js file