Is there a useful difference between app.all(\'*\', ... )
and app.use(\'/\', ...)
in Node.JS Express?
Yes, app.all()
gets called when a particular URI is requested with any type of request method (POST, GET, PUT, or DELETE)
On other hand app.use()
is used for any middleware you might have and it mounts onto a path prefix, and will be called anytime a URI under that route is requested.
Here is the documentation for app.all & app.use.