Difference between app.use('*') and app.all('*') in Express

express, node.js

Solution

`app.all()` references the application router like `post` or `get`, while `app.use()` simply references the applications middleware. `app.use()` is better for more globally defined statements that you want persistent through your entire application.

Problem

Is there a difference between ``` app.use('*', function (req, res, next) { }); ``` and... ``` app.all('*', function (req, res, next) { }); ```

Original source

Related problems