The file server part of my application is similar to Nextcloud Files and I am storing the files in a folder that is set up in express with router.use(express.static('files'))
Problem is, when I upload an .html file with my application, when it redirects to /files res.redirect('/files') instead of rendering the files.pug template like it normally does and as specified in the router, it renders the newly uploaded .html file.
router.get('/files', (req, res) => {
res.render('files', {
someData: goingIn
})
})
I've been searching but it seems more folks are stuck on serving that .html file and not many are trying to stop it. Perhaps there is a better method that I am missing. Is there a way to stop express from rendering files in a static directory?