I am building my first Express.js application and am stuck with routing.
I provide static hosting:
app.use("/", express.static("public"));
And then I have a wildcard pattern:
router.get("/:page", function(req, res) {
});
This route is suitable for the URLs such as " /about
" and " /contact
" that I want. But it looks like he is also trying to match " /style.css
" and other static asset files, which is not necessary.
How to make this template not match asset files?
source
share