From 75ecc948902e64c8a3dc88b225a070205fa45f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Wed, 8 Jan 2014 09:18:06 +0100 Subject: [PATCH 1/2] Mount REST API at app.get('restApiRoot') --- templates/app.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/app.js b/templates/app.js index f7eff0e9..132106d6 100644 --- a/templates/app.js +++ b/templates/app.js @@ -51,8 +51,7 @@ app.use(loopback.methodOverride()); */ // LoopBack REST interface -var apiPath = '/api'; -app.use(apiPath, loopback.rest()); +app.use(app.get('restApiRoot'), loopback.rest()); // API explorer (if present) var explorerPath = '/explorer'; From ce1025feefadfee182354305e7b66fe1f09f0e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Wed, 8 Jan 2014 09:18:18 +0100 Subject: [PATCH 2/2] Remove loopback-explorer's basePath option Do not pass app.get('restApiRoot') as a basePath to loopback-explorer, since the plugin is already using it as a default. --- templates/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/app.js b/templates/app.js index 132106d6..ddbb5b55 100644 --- a/templates/app.js +++ b/templates/app.js @@ -58,7 +58,7 @@ var explorerPath = '/explorer'; var explorerConfigured = false; try { var explorer = require('loopback-explorer'); - app.use(explorerPath, explorer(app, { basePath: apiPath })); + app.use(explorerPath, explorer(app)); explorerConfigured = true; } catch(e){ // ignore errors, explorer stays disabled