diff --git a/lib/loopback.js b/lib/loopback.js index f6fbb293..cdc9d296 100644 --- a/lib/loopback.js +++ b/lib/loopback.js @@ -59,6 +59,8 @@ function createApplication() { merge(app, proto); + app.loopback = loopback; + // Create a new instance of models registry per each app instance app.models = function() { return proto.models.apply(this, arguments); diff --git a/test/app.test.js b/test/app.test.js index 803fcdaf..139e24ea 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -585,4 +585,9 @@ describe('app', function() { expect(app.connectors.FOOBAR).to.equal(loopback.Memory); }); }); + + it('exposes loopback as a property', function() { + var app = loopback(); + expect(app.loopback).to.equal(loopback); + }); });