loopback/lib
Miroslav Bajtoš 2baa4b03a3 Scope app middleware to a list of paths
Add a new argument to `app.middleware` allowing developers
to restrict the middleware to a list of paths or regular expresions.

Modify `app.middlewareFromConfig` to pass `config.paths` as the second
arg of `app.middleware`.

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);

    // From config
    app.middlewareFromConfig(
      handlerFactory,
      {
        phase: 'initial',
        paths: ['/scope', /^\/(a|b)/]
      });
2014-11-19 15:42:54 +01:00
..
connectors Enable jscs for `lib`, fix style violations 2014-11-04 08:25:33 +01:00
access-context.js Enable jscs for `lib`, fix style violations 2014-11-04 08:25:33 +01:00
application.js Coding style cleanup (Gruntfile, lib) 2014-11-04 08:25:35 +01:00
browser-express.js Emit a 'modelRemoted' event by app.model() 2014-07-24 17:00:27 -07:00
builtin-models.js models: move Change LDL def into a json file 2014-10-14 09:04:43 +02:00
express-middleware.js Enable jscs for `lib`, fix style violations 2014-11-04 08:25:33 +01:00
loopback.js Move middleware sources to `server/middleware` 2014-11-12 12:44:34 +01:00
model.js Fix the model name for hasMany/through relation 2014-11-17 09:44:20 -08:00
persisted-model.js Minor: update jsdoc for PersistedModel.updateAll 2014-11-14 20:06:08 -08:00
registry.js Allows ACLs/settings in model config 2014-11-07 11:14:40 -08:00
runtime.js Enable jscs for `lib`, fix style violations 2014-11-04 08:25:33 +01:00
server-app.js Scope app middleware to a list of paths 2014-11-19 15:42:54 +01:00