Answer the question
In order to leave comments, you need to log in
How to redirect to 404 when there are no use names?
There is where use
app.use("/", ...)
app.use("/about", ...)
app.use("/info", ...)
And how to process those requests that are not, to give 404?
After all, all requests are *, and then it will block all these, and I only need those that the expert did not find in use.
Answer the question
In order to leave comments, you need to log in
Connect the last route *.
Express will search in order, if it doesn't find a match, it will route to *
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question