-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scope app middleware to a list of paths
Add a new argument to `app.defineMiddlewarePhases` allowing developers to restrict the middleware to a list of paths or regular expresions. Examples: // A string path (interpreted via path-to-regexp) app.middleware('auth', '/admin', ldapAuth); // A regular expression app.middleware('initial', /^\/~(admin|root)/, rejectWith404); // A list of scopes app.middleware('routes', ['/api', /^\/assets/.*\.json$/], foo);
- Loading branch information
Miroslav Bajtoš
committed
Nov 19, 2014
1 parent
768dc4a
commit dbf4d12
Showing
3 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters