Commit Graph

9 Commits

Author SHA1 Message Date
Miroslav Bajtoš 7ee8703ff5 Rework the module to a loopback component
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
2015-08-10 16:51:03 +02:00
Miroslav Bajtoš 2ec096a278 Add an option `uiDirs`
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.
2014-10-24 19:24:34 +02:00
Samuel Reed 32f0f5e37d Allow passing a custom protocol.
This allows swagger definitions to work properly when the API is behind
an SSL terminator.
2014-07-27 21:44:14 -05:00
Samuel Reed 6224243791 Remove preMiddleware.
Not necessary since this can easily be done with an app.use() before
calling loopback-explorer.
2014-07-10 14:16:10 -05:00
Samuel Reed 70dddef296 Use express routes instead of modifying remoting.
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}.
2014-07-09 18:13:47 -05:00
Samuel Reed 56003f0178 Load swagger ui from `swagger-ui` package instead.
Added option `swaggerDistRoot` for specific file overrides.
2014-07-04 14:28:47 -05:00
Miroslav Bajtos 2686f254cf README: mount REST at /api in the sample code 2013-12-09 18:12:30 +01:00
Ritchie Martori 1b8de3673c Readme updates 2013-11-05 11:24:48 -08:00
Ritchie Martori e95d3f1f63 Initial commit 2013-11-05 09:59:05 -08:00