Express serves my static files just fine when I'm on my "/" and "/home" page, however when I go to "/home/download" my files are no longer served. Im using EJS to render my pages.
router.get("/download", isAuthed, (req, res) => {
res.render("download", {
username: req.user.username,
discordId: req.user.discordId,
avatar: req.user.avatar,
discriminator: req.user.discriminator
})
})
This is my /home router
and this is where I tell express to serve my public folder
app.use(express.static(path.join(__dirname, "public")))
If there is something I've left out that would help you figure out what is wrong please let me know thanks.
Update: I change to the /home/download page when a link is pressed on the /home page
<a class="nav-link nav-color mt-4" href="/home/download">Download</a>
If this is whats causing the files not to be served how can I then change pages.