diff --git a/lib/application.js b/lib/application.js index 44e35b1d..8d0254cd 100644 --- a/lib/application.js +++ b/lib/application.js @@ -395,6 +395,17 @@ app.enableAuth = function(options) { this.isAuthEnabled = true; }; +app.controller = function(controllerCtor, options) { + var self = this; + SharedClass = RemoteObjects.SharedClass; + + controllerCtor._sharedClass = new SharedClass(controllerCtor.name); + controllerCtor._sharedClass.resolve = function() { + return new controllerCtor(app, remotingContext); + }; + app.remotes().addClass(controllerCtor._sharedClass); +}; + app.boot = function(options) { throw new Error( '`app.boot` was removed, use the new module loopback-boot instead');