From c4db83ad43bb6d2ddf6f21e4e55b5888838d26e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 13 Jun 2014 10:27:23 +0200 Subject: [PATCH] Expose loopback as `app.loopback` The primary intention is to allow loopback plugins to determine the version of the loopback framework from the `app` object. --- lib/loopback.js | 2 ++ test/app.test.js | 5 +++++ 2 files changed, 7 insertions(+) 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); + }); });