Rework the exported function to conform to the component convention:
var loopback = require('loopback');
var explorer = require('loopback-explorer');
var app = loopback();
explorer(app, options);
Allow users to mount explorer as a middleware too:
app.use('/explorer', explorer.routes(app, options));
- drop dependency on express
- drop support for loopback 1.x
- add a new option "mountPath" to specify where to mount the explorer UI
and swagger metadata
- describe upgrading from v1.x in README
The `uiDirs` option allows users to provide their own set of directories
with UI files, e.g. to provide a custom swagger-ui fork and a custom
set of style/font overrides:
explorer(app, {
uiDirs: [
path.resolve(__dirname, 'public'),
path.resolve(__dirname, 'node_modules', 'swagger-ui')
]
});
The existing option `swaggerDistRoot` is deprecated now.
This completes the migration of swagger processing from strong-remoting
into loopback-explorer.
Added additional usage instructions to README and additional testing.
This commit introduces a change into where resource descriptors
are hosted. They are no longer hosted under /swagger, but instead
under the same path as the Explorer, wherever that may be.
Generally, the resource listing will be available at
/explorer/resources, and api listings under
/explorer/resources/{modelName}.