Wildcards don't work anymore in v5
See original GitHub issueHi,
I’m using express to serve an Angular app. This has a few files which need to be served statically (index.html
, some css, js and images) and then has its own routing which means that all other URLs need to serve the index.html
.
In Express 4 I was able to do this:
app.use("/", express.static("/app/dist/frontend", {dotfiles: "allow"}));
app.use("*", express.static("/app/dist/frontend/index.html", {dotfiles: "allow"}));
However, in Express 5 it always returns 404 for /myCustomRoute
…
Here are the logs (debug=*
):
body-parser:json skip empty body +13s
send stat "A:\app\dist\frontend\myCustomRoute" +13s
finalhandler default 404 +2ms
It doesn’t help to set fallthrough: true
…
I’d really like to contribute a fix if you can point me in the right direction. We really need Express 5 because of its improved error handling with promises.
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
The asterisk (*) wildcard no longer works when defining URLs ...
Issue 371888 : The asterisk (*) wildcard no longer works when defining URLs for whitelisting (using the Windows Group Policy Editor and chrome....
Read more >linux wildcard usage in cp and mv - Stack Overflow
Let's talk about how wildcards work for a minute. cp *.txt foo. doesn't actually invoke cp with an argument *.txt , if any...
Read more >Find and Replace with wildcards not working after Office update.
I have just updated my Office Software. Find and replace using wildcards no longer works. I want, for example, to delete everything between ......
Read more >JQL - Add wildcard functionality to versions
I was very disappointed to find out wild cards don't work for fix versions. ... in v3.0.1 of the plugin so that means...
Read more >Frequently Asked Questions - Snakemake - Read the Docs
I don't want expand to use every wildcard, what can I do? Snakemake complains about a cyclic dependency or a PeriodicWildcardError. What can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
🤦♂️Of course, sorry for that.
works.
Thanks for your efforts!
#4833 is also vaguely related. I realise that you could also do
.use('/', ...)
which should be the same as*
used to be