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:
parent
7b091d28d1
commit
6c4e780ab8
7
index.js
7
index.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue