I am trying to create an authentication system using EJS and PG database, but I am having trouble getting the routing and rendering to work.
In my index.html I have an anchor element that points to signup.html, which works. In signup.html I have a login form, but then when I try to submit it, I get an HTTP 405 error.
How do I properly set up the routing between index.html, signup.html, and app.js (where the authentication logic happens)?
index.html:
<a href="signup.html" class="auth-link">Sign Up</a>
signup.html:
<form action="/users/register" method="POST">
app.js:
app.get("/users/register", checkAuthenticated, (req, res) => {
res.render("register.ejs");
});