I'm trying to render a page, but the static files are not being loaded by Express only on routes with a single parameter
Static configuration:
app.use(express.static(path.resolve(__dirname, "public")));
Route:
routes.get("/param/:id", (req, res) => res.render("page"));
Error:
Failed to load resource: the server responded with a status of 404 (Not Found)
Refused to execute script from 'http://localhost:port/param/1/assets/js/bundle.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
I've tried everything; maybe it has something to do with the structure of my project?
Repo: projeto-agenda
static
to:app.use(express.static(path.join(__dirname, '/public')));
/
eg:<script src="/assets/js/bundle.js"></script>