Commit Graph

185 Commits

Author SHA1 Message Date
Raymond Feng ca9cd5641f v2.8.4 2014-12-08 11:21:20 -08:00
Miroslav Bajtoš 577e496b29 v2.8.3 2014-12-08 08:07:51 +01:00
Ryan Graham 7c0b2e83eb Remove unused underscore dependency 2014-12-02 21:53:30 -08:00
Miroslav Bajtoš 4ee05df20f v2.8.2 2014-11-27 10:01:11 +01:00
Miroslav Bajtoš d864972bc6 v2.8.1 2014-11-25 11:21:46 +01:00
Raymond Feng 503d0144cf v2.8.0 2014-11-19 11:38:56 -08:00
Raymond Feng a9b4df1f2d Expose more loopback middleware for require 2014-11-19 11:32:22 -08:00
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
Miroslav Bajtoš c29ace3404 Update chai to ^1.10.0 2014-11-11 11:04:40 +01:00
Miroslav Bajtoš a22474d454 package: fix deps
Move loopback-phase from "devDependencies" to "dependencies".
2014-11-11 08:41:51 +01:00
Miroslav Bajtoš 4e1433b519 Middleware phases - initial implementation
Modify the app and router implementation, so that the middleware is
executed in order defined by phases.

Predefined phases:

    'initial', 'session', 'auth', 'parse', 'routes', 'files', 'final'

Methods defined via `app.use`, `app.route` and friends are executed
as the first thing in 'routes' phase.

API usage:

    app.middleware('initial', compression());
    app.middleware('initial:before', serveFavicon());
    app.middleware('files:after', loopback.urlNotFound());
    app.middleware('final:after', errorHandler());

Middleware flavours:

    // regular handler
    function handler(req, res, next) {
      // do stuff
      next();
    }

    // error handler
    function errorHandler(err, req, res, next) {
      // handle error and/or call next
      next(err);
    }
2014-11-10 19:50:58 +01:00
Raymond Feng 246f38c05d Add context propagation middleware
- Implement the middleware `loopback.context`
 - Inject context into juggler and strong-remoting
 - Make http context optional and default to false
 - Optionally mount context middleware from `loopback.rest`
2014-11-05 09:13:44 +01:00
Rob Halff 33096dafa7 Enable jscs for `lib`, fix style violations 2014-11-04 08:25:33 +01:00
Raymond Feng 04729fdffa Bump version 2014-10-27 09:46:34 -07:00
Miroslav Bajtoš d08e296f48 2.6.0 2014-10-23 13:43:29 +02:00
Ritchie Martori 360063a5d2 2.5.0 2014-10-15 11:57:46 -07:00
Miroslav Bajtoš 59457eef6f 2.4.1 2014-10-10 19:51:52 +02:00
Ritchie Martori b00bce330f 2.4.0 2014-10-01 15:01:13 -07:00
Krishna Raman b5516757ae Move looback remote connector to npm module 2014-10-01 14:48:34 -07:00
Ritchie Martori 17ac0e8dd4 2.3.1 2014-10-01 13:39:07 -07:00
Ritchie Martori 056a392649 2.3.0 2014-10-01 10:55:53 -07:00
Ritchie Martori 724b721144 Update strong-remoting version 2014-10-01 10:55:28 -07:00
Raymond Feng 4a536ee6fe Bump versions 2014-09-12 23:29:43 -07:00
Miroslav Bajtoš 642229f513 package: add "web" keyword
Close #538
2014-09-06 19:28:58 +01:00
Ritchie Martori 964a357286 2.1.4 2014-08-26 10:02:42 -07:00
Raymond Feng c28b870784 Bump version 2014-08-18 21:49:08 -07:00
Ritchie Martori d82d789ffa 2.1.2 2014-08-11 10:55:34 -07:00
Raymond Feng 22bca61f32 Bump version 2014-08-08 15:57:11 -07:00
Raymond Feng a053204eca Bump version 2014-08-07 10:40:22 -07:00
Raymond Feng 06c5267d92 Bump version 2014-07-27 00:45:20 -07:00
Raymond Feng 0297ba3a79 Bump version 2014-07-26 14:30:13 -07:00
Al Tsang d877f0edf9 Update package.json 2014-07-25 21:14:27 -07:00
Miroslav Bajtoš 8687267f66 2.0.0 2014-07-22 20:37:38 +02:00
Raymond Feng e5b64c6143 Upgrade to nodemailer 1.0.1 2014-07-16 12:40:15 -07:00
Raymond Feng ff9bc10c06 Bump version 2014-07-16 09:09:50 -07:00
Raymond Feng 79f504a3c7 Merge branch 'master' into 2.0 2014-07-16 09:09:07 -07:00
Raymond Feng 9125218eab Remove unused dep 2014-07-15 16:47:13 -07:00
Raymond Feng 7fe347763b Bump version and update deps 2014-07-15 16:44:09 -07:00
Raymond Feng 7b36196561 Merge pull request #362 from strongloop/feature/remoting-add-remove
Add a test case for hasMany through add/remove remoting
2014-07-15 16:15:27 -07:00
Raymond Feng 54b13f4feb Upgrade to loopback-datasource-juggler@1.7.0 2014-07-15 16:15:02 -07:00
Miroslav Bajtoš e18ee116c1 2.0.0-beta6 2014-07-15 20:53:03 +02:00
Raymond Feng a98db0bf86 Remove unused deps 2014-07-08 08:55:06 -07:00
Miroslav Bajtoš be48a504e0 2.0.0-beta5 2014-07-03 10:14:41 +02:00
Miroslav Bajtoš 10d29c7d86 Merge branch 'master' into 2.0
Conflicts:
	package.json
2014-06-27 10:36:06 +02:00
Miroslav Bajtoš 57060ec4c1 v1.9.1 2014-06-27 10:25:47 +02:00
Miroslav Bajtoš f92d18939a 2.0.0-beta4 2014-06-26 14:58:58 +02:00
Miroslav Bajtoš fb66bf5c44 package: upgrade juggler to 2.0.0-beta2 2014-06-26 13:31:41 +02:00
Miroslav Bajtoš 50816ebbe3 Fix loopback in PhantomJS, fix karma tests
- Move configuration of Karma unit-tests from `Gruntfile.js` to a
  standalone file (`test/karma.conf.js`).

- Add a new Grunt task `karma:unit-ci` to run Karma unit-tests in
  PhantomJS and produce karma-xunit.xml file that can be consumed
  by the CI server.

- Add grunt-mocha-test, configure it to run unit-tests.

- Add `grunt test` task that runs both karma and mocha tests,
  detects Jenkins to produce XML output on CI server.

- Modify the `test` script in `package.json` to run
  `grunt mocha-and-karma` (an alias for `grunt test`).
  The alias is required to trick `sl-ci-run` to run `npm test`
  instead of calling directly `mocha`.

- Add `es5-shim` module to karma unit-tests in order to provide
  ES5-methods required by LoopBack.

- Fix `mixin(source)` in lib/loopback.js to work in PhantomJS.
  `Object.getOwnPropertyDescriptor()` provided by `es5-shim` does not
  work in the same way as in Node.
2014-06-26 13:30:09 +02:00
Miroslav Bajtoš 1daa93e448 Merge pull request #349 from lchenay/patch-2
Allow peer to use beta2 of datasource-juggler (and future)
2014-06-26 12:38:50 +02:00
Raymond Feng c20ecaf265 Bump version and update deps 2014-06-25 09:09:14 -07:00