From 292c7ad497d534d26c8df11d175ace671016fbad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 31 Oct 2014 10:06:57 +0100 Subject: [PATCH] Revert "rest handler options" --- lib/middleware/rest.js | 7 +++---- test/rest.middleware.test.js | 10 ---------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/middleware/rest.js b/lib/middleware/rest.js index 3a6f557d..5e91c7f4 100644 --- a/lib/middleware/rest.js +++ b/lib/middleware/rest.js @@ -12,21 +12,20 @@ module.exports = rest; /** * Expose models over REST. - * + * * For example: * ```js * app.use(loopback.rest()); * ``` * For more information, see [Exposing models over a REST API](http://docs.strongloop.com/display/DOC/Exposing+models+over+a+REST+API). * @header loopback.rest() - * @param {Object} options REST handler options. */ -function rest(options) { +function rest() { var tokenParser = null; return function (req, res, next) { var app = req.app; - var handler = app.handler('rest', options); + var handler = app.handler('rest'); if(req.url === '/routes') { res.send(handler.adapter.allRoutes()); diff --git a/test/rest.middleware.test.js b/test/rest.middleware.test.js index 809a4743..5b10302f 100644 --- a/test/rest.middleware.test.js +++ b/test/rest.middleware.test.js @@ -75,16 +75,6 @@ describe('loopback.rest', function() { }); }); - it('should support options', function(done) { - app.model(MyModel); - var supportedTypes = ['json', 'application/javascript', 'text/javascript']; - app.use(loopback.rest({supportedTypes: supportedTypes})); - request(app).get('/mymodels') - .set('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8') - .expect('Content-Type', 'application/json; charset=utf-8') - .expect(200, done); - }); - it('includes loopback.token when necessary', function(done) { givenUserModelWithAuth(); app.enableAuth();