Replace strong-remoting ext/swagger with app.docs

Use `app.docs()` to expose Swagger specs. This way we don't have to
depend on loopback's dependency strong-remoting.
This commit is contained in:
Miroslav Bajtoš 2014-01-07 16:13:34 +01:00
parent 7b091d28d1
commit 6c4e780ab8
1 changed files with 3 additions and 4 deletions

View File

@ -3,7 +3,6 @@
*/
var path = require('path');
var loopback = require('loopback');
var swagger = requireLoopbackDependency('strong-remoting/ext/swagger');
var express = requireLoopbackDependency('express');
var STATIC_ROOT = path.join(__dirname, 'public');
@ -13,13 +12,13 @@ module.exports = explorer;
* Example usage:
*
* var explorer = require('loopback-explorer');
* app.use('/explorer', explorer(app));
* app.use('/explorer', explorer(app, options));
*/
function explorer(loopbackApplication, options) {
var options = options || {};
var remotes = loopbackApplication.remotes();
swagger(remotes, options);
loopbackApplication.docs(options);
var app = express();
app.get('/config.json', function(req, res) {